Disable message notifications from active chatrooms#2021
Disable message notifications from active chatrooms#2021Bionicgitman wants to merge 9 commits intoprofanity-im:masterfrom
Conversation
|
Thanks for this PR! |
|
I have yet to include the AFK portion, I will submit it soon |
3e1e63c to
6f1f43e
Compare
sjaeckel
left a comment
There was a problem hiding this comment.
I just had a look at the existing implementation and found that we already have PREF_NOTIFY_ROOM_CURRENT resp. PREF_NOTIFY_CHAT_CURRENT. Did you try enabling those before making these changes?
The main difference is then the check for the idle time, which should happen inside prefs_do_room_notify() resp. prefs_do_chat_notify() and the time should maybe be configurable? (CC @jubalh) The ChatState is only for 1on1 chats, so we can't use that.
Makes sense :) |
There was a problem hiding this comment.
Thanks for the PR. In general, as it was mentioned earlier, disabling notification for the current chat room is already enabled in a form of a preference, condition for which is being checked inside of the prefs_do_chat_notify, called to calculate notify variable.
profanity/src/config/preferences.c
Line 334 in 5385cc2
I suggest to instead make changes in the prefs_do_chat_notify and prefs_do_room_notify, using configurable preference for idling, as it was suggested earlier by @sjaeckel.
src/event/server_events.c
Outdated
| mucwin->last_msg_timestamp = g_date_time_new_now_local(); | ||
|
|
||
| if (prefs_do_room_notify(is_current, mucwin->roomjid, mynick, message->from_jid->resourcepart, message->plain, mention, triggers != NULL)) { | ||
| if ((prefs_do_room_notify(is_current, mucwin->roomjid, mynick, message->from_jid->resourcepart, message->plain, mention, triggers != NULL) && !wins_is_current(window)) || ui_get_idle_time() > 1000) { |
There was a problem hiding this comment.
Same issue with conditions as explained in another comment.
|
@Bionicgitman ping |
Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
|
Unfortunately, it still duplicates functionality of |
|
Started working on adding idle time as an option. Tell me if there are any problems with it or if it isn't complete. |
|
Well, what's strange for sure is that there are a couple of merge commits. Maybe get rid of them so the tree is clean. And in the future just rebase. |
Currently Profanity sends notifications even if you are focused on the same chat window as the recipient message.
It should account for whenever profanity is the focused window or not.
See #1987 .