Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add stories compatibility #1592

Open
LunarN0v4 opened this issue Sep 24, 2024 · 8 comments
Open

[Feature Request] Add stories compatibility #1592

LunarN0v4 opened this issue Sep 24, 2024 · 8 comments

Comments

@LunarN0v4
Copy link

Adding support for stories, including managing story groups would be useful.
I'm making a bot which manages and creates stories for me, so I'd love to see this be added as a feature.

@scottslewis
Copy link

Also would like to see this enhancement. Would be willing to contribute to implementation and/or testing if desired.

@AsamK
Copy link
Owner

AsamK commented Oct 23, 2024

The first step would be to design a cli interface for sending stories (maybe sendStoryMessage) and managing distribution lists for story groups (maybe listStoryDistributionLists and updateStoryDistributionList) with parameters for all the different functionalities.

@LunarN0v4
Copy link
Author

LunarN0v4 commented Oct 23, 2024 via email

@AsamK
Copy link
Owner

AsamK commented Oct 24, 2024

I would have to dig deeper into the code to check whether it's actually required. It will definitely be more efficient to use distribution lists when sending multiple stories to the same set of people, because it can reuse the sender key.
For sending stories to an existing group it might not matter, but that needs to be checked.

@LunarN0v4
Copy link
Author

I would have to dig deeper into the code to check whether it's actually required. It will definitely be more efficient to use distribution lists when sending multiple stories to the same set of people, because it can reuse the sender key. For sending stories to an existing group it might not matter, but that needs to be checked.

Fair, but for certain use cases, having specific recipients would be useful rather than constantly updating a distribution group (this is the case for a bot I'm currently making and depends on this feature request, it would read Signal UUIDs from an encrypted database and send update logs to them whenever an update occurs).

@scottslewis
Copy link

I would like to confirm I'm on the right track in terms of adding signal-cli interface.

First, it looks to me that in terms of the libsignal call to implement this new signal-cli api, the primary method in the whisper API seems to be:

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

The impl of the above method seems to (mostly) turn around and call this method

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

which calls:

org.whispersystems.signalservice.api.SignalServiceMessageSender.sendSenderKeyDistributionMessage(DistributionId, List, List, SenderKeyDistributionMessage, Optional<byte[]>, boolean, boolean)

which calls

org.whispersystems.signalservice.api.SignalServiceMessageSender.sendMessageRx(SignalServiceAddress, SealedSenderAccess, long, EnvelopeContent, boolean, CancelationSignal, SendEvents, boolean, boolean, int)

which sends messages over a socket and receives responses.

question: Is it appropriate to define the signal-cli 'sendStoryMessage' to use the whispersystems sendGroupStory? sendGroupStory appears to have be primarily for delivering to one group (as the name implies), and not to specific recipients as @LunarN0v4 suggests would be a good feature. Or, would a it make more sense to not use sendGroupStory, and make the 'lower level' calls (e.g. sendSenderKeyDistributionMessage) in the signal-api impl?

Or perhaps two API methods: 'sendStory', and 'sendGroupStory'? Thanks.

@AsamK
Copy link
Owner

AsamK commented Nov 29, 2024

The most high level method should be used, so SignalServiceMessageSender.sendGroupStory should be the correct one.

In the official clients all story messages are sent to predefined recipient lists, that's why the method has group in its name. Sending to specific recipients should work by just creating a random distributionId, but I haven't checked if that might have other side effects.

I think just one method should suffice, sendStory or sendStoryMessage, that takes one or multiple RECIPIENT and -g group ids.

@scottslewis
Copy link

WDYT of this declaration ...in the Signal interface:

long sendStoryMessage(
		String message, List<String> attachments, List<String> recipients, List<byte[]> groupIds
) throws Error.AttachmentInvalid, Error.Failure, Error.InvalidNumber, Error.UntrustedIdentity;

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

No branches or pull requests

3 participants