Skip to content

Conversation

@scottslewis
Copy link

For issue #1592

With the above changes running in jsonrpc mode, if this is pasted into console:

{"jsonrpc":"2.0","method":"send","params":{"attachment":"C:\Users\slewi\Desktop\slewis.PNG","story":true,"group-id":"JTJ9xDBSHH3UNI2wSGfC8iBHNC/gyJfzAoh4R5ge2ow=","message":"MyMESSAGE1"},"id":17}

where there is a slewis.PNG image file, note new property "story":true, and group-id is an existing group of my creation with one other receiver in the group. The server responds:

{"jsonrpc":"2.0","result":{"results":[{"recipientAddress":{"uuid":"f483a783-d1e3-4c30-9373-8d22530b5353","number":"+19712072518"},"groupId":"JTJ9xDBSHH3UNI2wSGfC8iBHNC/gyJfzAoh4R5ge2ow=","type":"SUCCESS"}],"timestamp":1739838735451},"id":17}

But nothing gets through to any of the clients (i.e. the message/image does not appear for either member of the group, nor does it appear in other clients of mine as a posted story message.

If, however, I post this (no "story":true):

{"jsonrpc":"2.0","method":"send","params":{"attachment":"C:\Users\slewi\Desktop\slewis.PNG","group-id":"JTJ9xDBSHH3UNI2wSGfC8iBHNC/gyJfzAoh4R5ge2ow=","message":"MyMESSAGE1"},"id":16}
{"jsonrpc":"2.0","result":{"results":[{"recipientAddress":{"uuid":"f483a783-d1e3-4c30-9373-8d22530b5353","number":"+19712072518"},"groupId":"JTJ9xDBSHH3UNI2wSGfC8iBHNC/gyJfzAoh4R5ge2ow=","type":"SUCCESS"}],"timestamp":1739839925436},"id":16}

The following is retruned in response

{"jsonrpc":"2.0","method":"receive","params":{"envelope":{"source":"+19712072518","sourceNumber":"+19712072518","sourceUuid":"f483a783-d1e3-4c30-9373-8d22530b5353","sourceName":"Karen","sourceDevice":2,"timestamp":1739839987168,"serverReceivedTimestamp":1739839987271,"serverDeliveredTimestamp":1739839987272,"receiptMessage":{"when":1739839987168,"isDelivery":true,"isRead":false,"isViewed":false,"timestamps":[1739839925436]}},"account":"+15037568719"}}
{"jsonrpc":"2.0","method":"receive","params":{"envelope":{"source":"+19712072518","sourceNumber":"+19712072518","sourceUuid":"f483a783-d1e3-4c30-9373-8d22530b5353","sourceName":"Karen","sourceDevice":1,"timestamp":1739839987427,"serverReceivedTimestamp":1739839987439,"serverDeliveredTimestamp":1739839987440,"receiptMessage":{"when":1739839987427,"isDelivery":true,"isRead":false,"isViewed":false,"timestamps":[1739839925436]}},"account":"+15037568719"}}

And both the image and the message get through just fine...using the existing sendGroupMessage

In debugging, one thing that looks a little suspect is that on SendHelper.java:711 is thsi code:

   final GroupSendEndorsements groupSendEndorsements = null;//TODO

And the null groupSendEndorsements is subsequently used in the org.whispersystems.signalservice.api.SignalServiceMessageSender.sendGroupStory(DistributionId, Optional<byte[]>, List, List, GroupSendEndorsements, boolean, SignalServiceStoryMessage, long, Set, PartialSendBatchCompleteListener)

Which ends up calling

org.whispersystems.signalservice.api.SignalServiceMessageSender.sendGroupMessage(DistributionId, List, List, GroupSendEndorsements, long, Content, ContentHint, Optional<byte[]>, boolean, SenderKeyGroupEvents, boolean, boolean)

which has this line 2524 in SignalServiceMessageSender

SealedSenderAccess sealedSenderAccess = SealedSenderAccess.forGroupSend(groupSendEndorsements, unidentifiedAccess, story);

and groupSendEndorsements is null. Perhaps groupSendEndorsements needs to be non-null for the server to accept it?

Thanksinadvance for any help debugging this. Unfortunately, I do not know the Android Client or Desktop Client code well enough (nor have a dev environment for it yet to debug)...or I might be able to trace through the sending of a story through those UIs, to look at what arguments are passed into

org.whispersystems.signalservice.api.SignalServiceMessageSender.sendGroupStory(DistributionId, Optional<byte[]>, List, List, GroupSendEndorsements, boolean, SignalServiceStoryMessage, long, Set, PartialSendBatchCompleteListener)

@scottslewis
Copy link
Author

@AsamK

I've been trying to figure out how to get a hold of the GroupSendEndorsements needed for calling SealedSenderAccess.forGroupSend as described in above.

There is this code in GroupHelper class

`private GroupChange handleGroupChangeResponse(
final GroupInfoV2 groupInfoV2,
final GroupChangeResponse groupChangeResponse
) {
ReceivedGroupSendEndorsements groupSendEndorsements = dependencies.getGroupsV2Operations()
.forGroup(GroupSecretParams.deriveFromMasterKey(groupInfoV2.getMasterKey()))
.receiveGroupSendEndorsements(account.getAci(),
groupInfoV2.getGroup(),
groupChangeResponse.groupSendEndorsementsResponse);

    // TODO save group endorsements

    return groupChangeResponse.groupChange;
}

`

The TODO implies to me that the group endorsements needed to send a story message for the group have to be stored on the client....or accessed in some other way at story message send time. Is that right? Could you please let me know if there is some other code that shows how to save/store as per your TODO...or just access at send story time the group send endorsements?

Thanks.

@AsamK
Copy link
Owner

AsamK commented Apr 5, 2025

Indeed group endorsements are still on my todo list, as I don't know yet what they are exactly.
They will have to be saved in the database somehow, probably similar to how the Android app does it.
But I will need some spare time to investigate how this works in Signal-Android.

@LunarN0v4
Copy link

i was taking a look at my issue and saw this
ill take a look as well into group endorsements and report any findings here
(part of me is wishing that signal would just provide an api for bots, but we know that probably wont be happening any time soon ;-;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants