You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
signal4j does not offer (?) a way to send messages to groups, if the user knows only the groupid, because signal4j won't tell you the group's members.
In the sample plugins this works nicely as they only respond to group messages and thus get a handle to the group object, but a plugin that wants to send messages without receiving some does not.
I have added a new sendMessage overload to SignalService to have a dirty workaround:
public void sendMessage(String groupId, String content) throws IOException {
byte[] id = Base64.decode(groupId);
Group group = store.getDataStore().getGroup(new GroupId(id));
SignalServiceDataMessage message = SignalServiceDataMessage.newBuilder()
.withTimestamp(System.currentTimeMillis())
.asGroupMessage(SignalServiceGroup.newBuilder(Type.DELIVER)
.withId(group.getId().getId())
.build())
.withBody(content)
.withExpiration(group.getMessageExpirationTime())
.build();
sendMessage(group.getMembers(), message);
}
What did you intend?
The text was updated successfully, but these errors were encountered:
I intend that you keep the Group object as a handle for later reference instead of the group id. However, I understand that this would need an additional serialization process outside the library. Maybe it would be better to provide a function for getting the associated Group object from the groupId, maybe in DataStore. Additional methods for User etc. should be taken in consideration.
This would allow an application to only save the ids.
signal4j does not offer (?) a way to send messages to groups, if the user knows only the groupid, because signal4j won't tell you the group's members.
In the sample plugins this works nicely as they only respond to group messages and thus get a handle to the group object, but a plugin that wants to send messages without receiving some does not.
I have added a new sendMessage overload to SignalService to have a dirty workaround:
What did you intend?
The text was updated successfully, but these errors were encountered: