Open guruz opened 5 years ago
im not sure that i am a big fan of this. i think the proper way should be by having the quassel-server send a notification via another service. i currently do this via qpush.me or similar. that's also suboptimal, but this sounds battery intense. :\
Note to self: AFAIK iOS launches every 15-20 minutes
From https://quassel-irc.org/node/134
For example, chat activity tracking and highlight rules moved into the core, so clients don't need to pull all the backlog at once
@justjanne Which API is that? Could I from that easily compute e.g. "number of buffers with hilight" + "number of buffers with unread private message" to set the iOS app icon badge number?
The BufferSyncer now has two new maps, activity and highlightcount https://github.com/quassel/quassel/blob/master/src/common/buffersyncer.h
Activity stores for each buffer the bitset of activities – so join|part|quit|topic|nickchange|privmsg|notice, etc.
This allows you to figure out if you should show a buffer as green, blue, or nothing in the chat list.
Blue: if the activity has either notice or privmsg flags set
For green, you can either just see if activity is != 0, or you can do it more intelligently. If you allow users to hide join/part/quits, you just have your bitset of hidden flags (e.g. hide is [join|part]), then you just do activity & ~hide, and you get only the activities which are not hidden. So you just define Green as "activity & ~hide != 0".
For highlights, it’s even more interesting, as it just stores for each buffer the number of unread highlights.
Then there’s the new backlog API: https://github.com/quassel/quassel/blob/master/src/common/backlogmanager.h#L40, where you can use requestBacklogFiltered to only request messages which have certain flags (e.g. highlight) set.
That’s btw how we load notifications for Quasseldroid (pseudocode):
for each buffer:
if in this buffer all messages notify:
requestbacklog for this buffer, no filter, maximum 20 messages, only unread
show them as notification
if in this buffer highlights notify:
requestbacklogfiltered for this buffer, only highlights, maximum 20 messages, only unread
show them as notification
if in this buffer no messages notify:
do nothing
Simple message notifications by having the app background-launched by iOS every few minutes
This will be in next version :)
I see the Pushover iOS app has integrations for a number of services already, including ZNC Push bouncer. Maybe we could get one there for Quassel?
...so that we don't need a push infrastructure