Skip to content

Commit ffd8d44

Browse files
committed
Added support to get conversation list mode and messages from a number, '-f <number>' param to get from specefic phone number, '-c' param to get a conversation list mode
1 parent de0d968 commit ffd8d44

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

scripts/termux-sms-list

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ set -u
33

44
PARAM_LIMIT=10
55
PARAM_OFFSET=0
6-
PARAM_TYPE=inbox
6+
PARAM_TYPE= all
7+
PARAM_NUMBER=""
78
PARAMS=""
89

910
SCRIPTNAME=termux-sms-list
@@ -12,12 +13,15 @@ SUPPORTED_TYPES="all|inbox|sent|draft|outbox"
1213
show_usage () {
1314
echo "Usage: $SCRIPTNAME [-d] [-l limit] [-n] [-o offset] [-t type]"
1415
echo "List SMS messages."
15-
echo " -d show dates when messages were created"
1616
echo " -l limit offset in sms list (default: $PARAM_LIMIT)"
17-
echo " -n show phone numbers"
1817
echo " -o offset offset in sms list (default: $PARAM_OFFSET)"
1918
echo " -t type the type of messages to list (default: $PARAM_TYPE):"
2019
echo " $SUPPORTED_TYPES"
20+
echo " -c conversation list (unique item per conversation)"
21+
echo " -f number the number for locate messages"
22+
23+
echo " -n (obsolete) show phone numbers"
24+
echo " -d (obsolete) show dates when messages were created"
2125
exit 0
2226
}
2327

@@ -30,6 +34,9 @@ do
3034
n) PARAMS="$PARAMS --ez show-phone-numbers true";;
3135
o) PARAM_OFFSET=$OPTARG;;
3236
t) PARAM_TYPE=$OPTARG;;
37+
38+
u) PARAMS="$PARAMS --ez conversation-list true";;
39+
f) PARAM_NUMBER=" --es from $OPTARG";;
3340
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
3441
esac
3542
done
@@ -46,5 +53,5 @@ case "$PARAM_TYPE" in
4653
*) echo "$SCRIPTNAME: Unsupported type '$PARAM_TYPE'. Use one of: $SUPPORTED_TYPES"; exit 1 ;;
4754
esac
4855

49-
PARAMS="$PARAMS --ei offset $PARAM_OFFSET --ei limit $PARAM_LIMIT --ei type $PARAM_TYPE"
56+
PARAMS="$PARAMS --ei offset $PARAM_OFFSET --ei limit $PARAM_LIMIT --ei type $PARAM_TYPE $PARAM_NUMBER"
5057
@TERMUX_PREFIX@/libexec/termux-api SmsInbox $PARAMS

0 commit comments

Comments
 (0)