feat(omemo): suppress repetitive missing device ID warnings
When sending OMEMO messages, we print a warning message for every participant without a device ID on every single send: ``` Can't find a OMEMO device id for my@jid.org ``` This clutters the UI due to the high volume of repetitive information. This is solved by tracking suppressed warnings within the window structure. A warning for a specific JID and type is only shown once per window context. Suppression state is stored in the base ProfWin structure and managed via helper functions (win_warn_needed, win_warn_sent). The state is lazily initialized to save resources and automatically cleaned up when the window is closed. Warnings are explicitly reset when an OMEMO session is started or ended to ensure users see fresh alerts when toggling encryption.
This commit is contained in:
@@ -1318,6 +1318,22 @@ win_refresh_with_subwin(ProfWin* window)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
win_warn_needed(ProfWin* window, const char* const type, const char* const jid)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
win_warn_sent(ProfWin* window, const char* const type, const char* const jid)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
win_clear_warned_jids(ProfWin* window)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
win_println(ProfWin* window, theme_item_t theme, const char* ch, const char* const message, ...)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user