
In sxmo_modemmonitor.sh checkfornewtexts() we should skip MMS and SMS WAPs, which will be SMS messages with text of "--" or no TEXTDATA at all. Hence, there are a couple small checks in checkfornewtexts() to do that. As well, there is a further dbus-monitor call in sxmo_modemmonitor.sh that monitors org.ofono.mms.Service for 'MessageAdded' to process a new MMS messages. Most of the action happens in sxmo_modemmonitor.sh processmms(). An MMS message might be either a message with an attachment to one recipient OR a message with multiple recipients ('Group Chat') and no attachments (or some attachments). Attachments get placed in ~/.local/share/sxmo/modem/$PHONENUMBER/attachments/. They are named $PAYLOAD.jpeg, $PAYLOAD.mp3, etc., where $PAYLOAD is the unique id that mmsd-tng assigns the mms and stores in ~/.mms/modemanager/. (Note that since the PAYLOAD file remains on the filesystem, we could just re-extract the attachments whenever we want them. This might be an improvement down the road.) If there are multiple recipients, we will make a "unique" new phone number out of *all* the numbers involved (to and from) for each group chat. For instance, if you and Bob and Suzie are on a group chat you will have a number like +15551234567+16661234567+17771234567 in ~/.local/share/sxmo/modem. You can treat this like a normal number (i.e., give it a contact name, reply to it, etc.) Once an MMS message has arrived, one notification will be made like normal. If there are attachments, clicking on the notification will open them all using sxmo_open.sh. You can also go to the message (via Texts) and click View Attachments to run sxmo_files.sh on the attachments directory. You can also Add an attachment when you compose a message. There is a basic ability to Delete attachments too. I've also reversed the contact lists so the CONTACTNAME is on the left and PHONENUMBER on the right, otherwise with large phonenumbers it was hard to see who the CONTACTNAME is. === MMSD-TNG CONFIGURATION TIPS AND TRIPS === sxmo's mms requires mmsd-tng that includes the mmsctl program. Right now, this is in the latest git head. See https://gitlab.com/kop316/mmsd/-/merge_requests/52. To compile with this on edit meson_options.txt and set mmsctl to true. Then build as normal via mmsd-tng's README. (We can also just do: gcc -o mmsctl mmsctl.c -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -ldbus-1 -ljson-c) sxmo's mms does not require any configuration on top of what is needed to get mmsd-tng to work. However, mmsd-tng can be a bit of a tricky thing to confugre, so here are some tips: 1. mmsd-tng includes example configurations in its README. A helpful list is here: https://gitlab.gnome.org/GNOME/mobile-broadband-provider-info Here is an example (works with "Mint Mobile" which uses T-Mobile): ~/.mms/modemmanager/mms [Modem Manager] CarrierMMSC=http://wholesale.mmsmvno.com/mms/wapenc MMS_APN=Ultra CarrierMMSProxy=NULL DefaultModemNumber=NULL AutoProcessOnConnection=true AutoProcessSMSWAP=true [Settings] UseDeliveryReports=false AutoCreateSMIL=false ForceCAres=false TotalMaxAttachmentSize=1100000 MaxAttachments=25 2. mmsd-tng must use the *modem's* dns to resolve mms files. Since NetworkManager rewrites /etc/resolv.conf with both wifi and modem active, I found it easiest to have a static /etc/resolv.conf and to set /etc/NetworkManager/NetworkManager.conf dns=none.
90 lines
1.5 KiB
Bash
Executable File
90 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
# include common definitions
|
|
# shellcheck source=scripts/core/sxmo_common.sh
|
|
. "$(dirname "$0")/sxmo_common.sh"
|
|
|
|
set -e
|
|
|
|
DIR="$1"
|
|
[ -z "$DIR" ] && DIR="$HOME"
|
|
cd "$DIR" || exit 1
|
|
|
|
[ -n "$2" ] && SELECTONLY=1
|
|
|
|
SORT=
|
|
REVERSE=
|
|
|
|
sort_loop() {
|
|
CHOICES="$([ -z "$SORT" ] && printf "date" || printf "name")\n$([ -z "$REVERSE" ] && printf "desc" || printf "asc")\n"
|
|
|
|
PICKED="$(
|
|
printf %b "$CHOICES" |
|
|
sxmo_dmenu.sh -p "Sort" -i
|
|
)"
|
|
|
|
case "$PICKED" in
|
|
"date")
|
|
SORT="--sort=t"
|
|
;;
|
|
"name")
|
|
SORT=
|
|
;;
|
|
"desc")
|
|
REVERSE="-r"
|
|
;;
|
|
"asc")
|
|
REVERSE=
|
|
;;
|
|
esac
|
|
}
|
|
|
|
|
|
while true; do
|
|
# shellcheck disable=SC2086
|
|
FILES="$(ls -1p $SORT $REVERSE)"
|
|
CHOICES="$(printf %b 'Reload\nOpen in terminal\nClose Menu\nSort By\n../\n*\n'"$FILES")"
|
|
DIR="$(basename "$(pwd)")"
|
|
TRUNCATED="$(printf %.7s "$DIR")"
|
|
if [ "$DIR" != "$TRUNCATED" ]; then
|
|
DIR="$TRUNCATED..."
|
|
fi
|
|
|
|
PICKED="$(
|
|
printf %b "$CHOICES" |
|
|
sxmo_dmenu.sh -p "$DIR" -i
|
|
)"
|
|
|
|
case "$PICKED" in
|
|
"Sort By")
|
|
sort_loop
|
|
;;
|
|
"Open in terminal")
|
|
cd "$(pwd)" && sxmo_terminal.sh && continue
|
|
;;
|
|
"Close Menu")
|
|
exit 0
|
|
;;
|
|
"Reload")
|
|
continue
|
|
;;
|
|
\*)
|
|
if [ -n "$SELECTONLY" ]; then
|
|
printf %s "Can't do this"
|
|
else
|
|
sxmo_open.sh -a ./*
|
|
fi
|
|
;;
|
|
*)
|
|
[ -d "$PICKED" ] && cd "$PICKED" && continue
|
|
if [ -f "$PICKED" ]; then
|
|
if [ "$SELECTONLY" -eq 1 ]; then
|
|
printf "%s" "$(pwd)/$PICKED" && exit
|
|
else
|
|
sxmo_open.sh -a "$PICKED"
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|
|
done
|