broadcast channel reactions#8450
Draft
r10s wants to merge 16 commits into
Draft
Conversation
r10s
force-pushed
the
r10s/channel-reactions
branch
26 times, most recently
from
July 25, 2026 13:51
a92e18b to
caf58c3
Compare
r10s
force-pushed
the
r10s/channel-reactions
branch
7 times, most recently
from
July 25, 2026 21:28
0d07a20 to
bbf5f8e
Compare
r10s
force-pushed
the
r10s/channel-reactions
branch
4 times, most recently
from
July 25, 2026 22:15
39ddfa2 to
0c297c2
Compare
r10s
force-pushed
the
r10s/channel-reactions
branch
from
July 25, 2026 22:18
0c297c2 to
a1b7008
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR adds support for reactions in broadcast channels:
1. reactions are send from broadcast channel subscriber (
Chattype::InBroadcast) to broadcast channel owner (Chattype::OutBroadcast) as usual, the only change needed for that was to allow sending reactions to channels (which havecan_send()==falseotherwise)2. the broadcast owner receives the reaction as usual, it gets added to
reactionstable without any code changes, and UI display them without any code changes as well3. to be able to detect the reactions to update at 4., however, we need to add the table
reactions_need_broadcastand set it when a reaction is set4. every some minutes, broadcast owner send a single, hidden message with accumulated reactions that happened in the channel the last minutes, for any message in the channel. for affected messages, the whole reaction state is sent, not a diff. after that, all rows with
chat_idare removed fromreactions_need_update.for the wire format, see below
5. the broadcast subscriber receives that message and applies the changes to
reactions_accumulated. this means that old entries for the givenmsg_idare deleted first6. unfortunately, the logic of
get_message_reactionssupporting reactions withcountfield is in the jsonrpc api, not in core. we have to move that to core before we can adaptget_message_reactionsin the next step.7. jsonrpc's
get_message_reactionsneeds to be adapted for channels: the result must be the union ofreactions_accumulatedandreactions. the latter is still needed so that the broadcast subscriber has a guarantee to see their own reaction even if offline or races occur.if is a bit unfortunate that the logic is in jsonrpc and not in the rust part at
get_msg_reactions, we may want to put that to rust.8. mute channels for channel owners by default so they do not get notified for reactions - in general, some ppl want these notifications, so they can unmute then. it is even easier in the UI to allow that than what we're doing currently, also telegram allows notifications for channel reactions (but also has them muted by default).
if it is easier, it is also fine to not notify reactions at all, we'll see if ppl at scale complain
finally, there is some cleanup done, reactions are removed from the (now) debug info; they were added there in a time where not all UI support reactions
wire format
wire format can be a JSON in the body of a mail with the header
Content-Disposition: reaction, as rendered already byParam::Reaction.for
id, the wire format needs to userfc724_midasmsg_idare local only.known issues
if the channel owner uses multiple devices, the reaction updates from 4. are sent from each device. the updates are not that big, so that is probably not a big deal. if it turns out that this is an issue, we can think about fixes in another PR. might be done by setting
updatedto a timestamp or so, and reset it when seeing and accumulated reaction update from another devicewe cannot set contact_id for DC_EVENT_REACTIONS_CHANGED - but i doubt it was ever used
for another pr
add
Broadcast-Reactions:header also for resent channel messages, so that new subscriber do not only get the latest messages, but also their reactions. for that, theBroadcast-Reactions:header can go to the corresponding message, no need to send extra messages. we would need to change the sending part to send all reactions for a given message. on receiving part, we need to make sure,receive_broadcast_reactions()is called when the message actually exist.add api to allow only a subset of reactions, fiter incoming reactions before broadcasting