Skip to content

fix: Dont OMEMO trust check so often#2108

Merged
jubalh merged 1 commit intomasterfrom
omemo-ux-fix
Mar 9, 2026
Merged

fix: Dont OMEMO trust check so often#2108
jubalh merged 1 commit intomasterfrom
omemo-ux-fix

Conversation

@jubalh
Copy link
Copy Markdown
Member

@jubalh jubalh commented Mar 9, 2026

a26cdf3 / #2104 added OMEMO trust status to the title bar, but it was being re-calculated on UI refresh.

Update only on certain operations (like /omemo trust, new device discoveries and even incoming OMEMO messages for example).

a26cdf3 / #2104 added OMEMO trust status to the
title bar, but it was being re-calculated on UI refresh.

Update only on certain operations (like `/omemo trust`, new device
discoveries and even incoming OMEMO messages for example).
@jubalh jubalh added this to the next milestone Mar 9, 2026
@jubalh jubalh self-assigned this Mar 9, 2026
@jubalh jubalh merged commit acba9d9 into master Mar 9, 2026
7 checks passed
@jubalh jubalh deleted the omemo-ux-fix branch March 9, 2026 12:23
Comment thread src/ui/window_list.c
Comment on lines +1000 to +1019
GList* curr = values;
while (curr) {
ProfWin* window = curr->data;
if (window->type == WIN_CHAT) {
ProfChatWin* chatwin = (ProfChatWin*)window;
if (jid == NULL || strcmp(chatwin->barejid, jid) == 0) {
#ifdef HAVE_OMEMO
chatwin->omemo_trusted = omemo_is_jid_trusted(chatwin->barejid);
#endif
}
} else if (window->type == WIN_MUC) {
ProfMucWin* mucwin = (ProfMucWin*)window;
if (jid == NULL || strcmp(mucwin->roomjid, jid) == 0) {
#ifdef HAVE_OMEMO
mucwin->omemo_trusted = omemo_is_jid_trusted(mucwin->roomjid);
#endif
}
}
curr = g_list_next(curr);
}
Copy link
Copy Markdown
Member

@sjaeckel sjaeckel Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GList* curr = values;
while (curr) {
ProfWin* window = curr->data;
if (window->type == WIN_CHAT) {
ProfChatWin* chatwin = (ProfChatWin*)window;
if (jid == NULL || strcmp(chatwin->barejid, jid) == 0) {
#ifdef HAVE_OMEMO
chatwin->omemo_trusted = omemo_is_jid_trusted(chatwin->barejid);
#endif
}
} else if (window->type == WIN_MUC) {
ProfMucWin* mucwin = (ProfMucWin*)window;
if (jid == NULL || strcmp(mucwin->roomjid, jid) == 0) {
#ifdef HAVE_OMEMO
mucwin->omemo_trusted = omemo_is_jid_trusted(mucwin->roomjid);
#endif
}
}
curr = g_list_next(curr);
}
#ifdef HAVE_OMEMO
GList* curr = values;
while (curr) {
ProfWin* window = curr->data;
if (window->type == WIN_CHAT) {
ProfChatWin* chatwin = (ProfChatWin*)window;
if (jid == NULL || strcmp(chatwin->barejid, jid) == 0) {
chatwin->omemo_trusted = omemo_is_jid_trusted(chatwin->barejid);
}
} else if (window->type == WIN_MUC) {
ProfMucWin* mucwin = (ProfMucWin*)window;
if (jid == NULL || strcmp(mucwin->roomjid, jid) == 0) {
mucwin->omemo_trusted = omemo_is_jid_trusted(mucwin->roomjid);
}
}
curr = g_list_next(curr);
}
#endif

No need to run this at all if there's no OMEMO.

Copy link
Copy Markdown
Member

@sjaeckel sjaeckel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still leaving this here, even though it's already merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants