Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore fake message IDs set by Protonmail #246

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
7 changes: 6 additions & 1 deletion mless
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ while :; do
LESSOPEN="|$0 --filter %s" \
less -Ps"mless %f?m (message %i of %m).." -R \
"+:e $(mscan -n .)$nl" //scan $(mscan -n :)
case "$?" in
_c="$?"
case "$_c" in
0|1) exit $?;;
36) # $ goto end
mseq -C '$' 2>/dev/null
Expand All @@ -105,6 +106,10 @@ while :; do
mseq -f : | mseq -S
mseq -C +
;;
117) # u extract URLs
_url="$(mshow -N -h ''| extract_url -l -c "$XDG_CONFIG_HOME"/urlview/config 2>&- | fzf)"
[ "$_url" != "" ] && handle-url "$_url"
;;
82) # R toggle raw mode
MLESS_RAW=$((1-$MLESS_RAW))
;;
Expand Down
9 changes: 9 additions & 0 deletions mthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ thread(char *file)
if (me == c)
continue;

// ugly, skip fake Protonmail mids
char *at = strchr(mid, '@');
if (at != NULL) {
const char *pi = "@protonmail.internalid";
const char *pc = "@protonmail.conversationid";
if (strcmp(at, pi) == 0 || strcmp(at, pc) == 0)
continue;
}

if (parent && !me->parent &&
!reachable(me, parent) && !reachable(parent, me)) {
me->parent = parent;
Expand Down