deltachat / deltachat-desktop

Email-based instant messaging for Desktop.
GNU General Public License v3.0
915 stars 166 forks source link

"Block Contact" chat menu item displayed for an already blocked contact instead of "Unblock" #4046

Open iequidoo opened 1 month ago

iequidoo commented 1 month ago

First of all, i believe this should be moved from the chat menu to the contact profile menu, see #4043 for discussion. At least on Android "Block/Unblock Contact" is there. (On Desktop there's no contact profile menu currently, you can only edit the contact name.) The second is that if a contact is already blocked, "Unblock Contact" should be displayed instead (as on Android). The third is that currently if i e.g. forgot that the contact is already blocked and do "Block Contact" again, the 1:1 chat is only deselected, but remains in the chatlist. But maybe this doesn't need to be fixed if "Unblock Contact" will be in the menu instead.

For reproduction: if you have a group with an already blocked contact, you can get to the 1:1 chat with it via the group members window >> click on the contact >> SEND MESSAGE.

r10s commented 1 month ago

the 1:1 chat is only deselected, but remains in the chatlist

i cannot reproduce that part. at least on my test on current master, blocked chats are directly removed from the chatlist. maybe there is some race, however.

+1 for the other points.

iequidoo commented 1 month ago

i cannot reproduce that part. at least on my test on current master, blocked chats are directly removed from the chatlist. maybe there is some race, however.

For me blocked 1:1 chats are removed from the chatlist only on first blocking. If i look up the chat somehow again (e.g. via a common group with the contact), it appears in the chatlist again and doesn't go away if i retry blocking. DC Desktop 1.46.1 (git: v1.33.0-881-g899f196d). Still, maybe this isn't worth fixing if "Block Contact" will be replaced with "Unblock Contact" if a contact is already blocked.

EDIT: But then it's a question what to do with such a reappeared 1:1 chat if the user doesn't want to unblock the contact. Hide it again after deselecting? Maybe this should be fixed in Core somehow.

EDIT: I suggest to debug why the chat reappears in the chatlist if the user only looked it up again. If the user didn't unblock it or draft/send any messages, so the contact/chat is still blocked, it shouldn't be shown in the chatlist.

EDIT: Checked Android, it's the same, the chat reappears. To hide it back the user should unblock the contact and block it again. Finally i think this is acceptable, may be even useful -- the user can message a blocked contact w/o unblocking it -- it really works.