Repository navigation
handlesignal,msgconv,signalmeow: add support for receiving stories - #726
iFixRobots wants to merge 7 commits into
Conversation
|
All clear! No issues remaining. 🎉 4 issues already resolved
All required CI checks passed on
Select any unchecked box below to run or rerun that agent. Full resultsIndent Review Agent
|
# Conflicts: # pkg/connector/config.go # pkg/connector/example-config.yaml # pkg/connector/handlesignal.go
| sc.UserLogin.Log.With().Str("component", "signalmeow").Logger(), | ||
| sc.handleSignalEvent, | ||
| ) | ||
| sc.Client.ReceiveStories = s.Config.EnableStories |
There was a problem hiding this comment.
I think the signal app has an option to turn off stories entirely. Is that synced? if yes, it should probably be respected
There was a problem hiding this comment.
Yes, it's synced as AccountRecord.storiesDisabled. It now works like Signal Desktop: X-Signal-Receive-Stories is only sent when enable_stories is on and stories aren't disabled, a change coming in through storage sync reconnects the authed websocket with the new header, and stories, story replies and story sync messages that still arrive while disabled are dropped. Fixed in cf0dcea.
| prefixBody(dm, "Replied to "+whose) | ||
| } | ||
| cm := mc.ToMatrix(ctx, client, portal, sender, intent, dm, attMap) | ||
| cm.ReplyTo = &networkid.MessageOptionalPartID{MessageID: storyID} |
There was a problem hiding this comment.
Should set ReplyToRoom since this is a cross-room reply
There was a problem hiding this comment.
Done in cf0dcea. Story replies and reactions now set ReplyToRoom to the stories room and ReplyToUser to the story author, plus ReplyToLogin for our own stories. DM replies link across rooms. Group story replies still don't, because getRelationMeta looks the target up with the group portal's receiver ("") while the story is stored under the login. I asked in the description whether bridgev2 should use ReplyToRoom.Receiver for that lookup; it works when I tried it locally.
The Signal server only delivers stories to websockets that send
X-Signal-Receive-Stories: true. Without that header it acks and drops them, so stories never reached the bridge. Replies to stories arrived as plain text and reactions to stories were dropped.With
enable_stories(off by default), the authed websocket requests stories and each login gets a "Signal Stories" room. Stories are sent there by the author's ghost, and group stories get a "Story in " caption. The room is receive-only.mute_storiesandstories_tagwork like whatsapp'smute_status_broadcastandstatus_broadcast_tag. Stories are removed from the room 24h after they're posted.The account's "Turn off stories" setting (
AccountRecord.storiesDisabled) is handled the same way Signal Desktop handles it. While it's on, the header isn't sent (SocketManager.preload.ts:246). A change that arrives through storage sync reconnects the authed websocket (storageRecordOps.preload.ts:2219-2221, SocketManager.preload.ts:525-533). Stories, story replies and story sync messages that still arrive are dropped (MessageReceiver.preload.ts:1559-1568, :2163, :3017).Story replies and reactions set
ReplyTo,ReplyToRoom(the stories room) andReplyToUser. Whencross_room_repliesis off, a "Replied to your story:" prefix is added. Group story replies carry the story's 24hexpireTimer, so they no longer change the group's disappearing timer.Deletes use envelope
story. Own list-story deletes sync as a recipient update. An own group story deleted from another device has no story marker, so it's left to expire.cross_room_repliesoffcross_room_repliesonQuestions for you:
cross_room_repliesis off?ReplyToRoomset. Would usingReplyToRoom.Receiverfor that lookup when it's set be OK?Tag
@indentto continue the conversation here.