Optimize sxmo_modemtext contact listing

When you number of conversation start to grow, it rapidly take some
seconds for the menu to open itself. The [ -d "folder" ] test really is
uneficient.

This simplify this part as we now ask sxmo_contacts to only list texted
contacts.
This commit is contained in:
Stacy Harper 2021-05-15 18:20:35 +02:00
parent 823ad95477
commit e444553ae4
No known key found for this signature in database
GPG key ID: 5BAC92328B7C5D65
2 changed files with 26 additions and 14 deletions

View file

@ -89,10 +89,7 @@ readtextmenu() {
# E.g. only display logfiles for directories that exist and join w contact name
ENTRIES="$(
printf %b "$icon_cls Close Menu\n$icon_edt Send a Text\n";
sxmo_contacts.sh | while read -r CONTACT; do
[ -d "$LOGDIR"/"$(printf %b "$CONTACT" | cut -d: -f1)" ] || continue
printf %b "$CONTACT" | xargs -IL echo "L logfile"
done
sxmo_contacts.sh --texted | xargs -IL echo "L logfile"
)"
PICKED="$(printf %b "$ENTRIES" | dmenu -p Texts -c -l 10 -i)" || exit