Skip to content

Commit

Permalink
fix for bug 363
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmintailor-db committed Aug 10, 2022
1 parent 0467bcf commit 714e323
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;
import java.util.Map;

import com.symphony.bdk.gen.api.model.StreamType;
import org.finos.springbot.entityjson.EntityJson;
import org.finos.springbot.symphony.conversations.SymphonyConversations;
import org.finos.springbot.workflow.actions.Action;
Expand Down Expand Up @@ -66,7 +67,10 @@ public void accept(RealTimeEvent<V4SymphonyElementsAction> event) {
}

EntityJson data = retrieveData(action.getFormMessageId());
Addressable rr = ruBuilder.loadRoomById(action.getStream().getStreamId());
Addressable rr = null;
if(action.getStream().getStreamType().equals(StreamType.TypeEnum.ROOM)) {
rr = ruBuilder.loadRoomById(action.getStream().getStreamId());
}
User u = ruBuilder.loadUserById(event.getInitiator().getUser().getUserId());

// if we're not in a room, address the user directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;

import com.symphony.bdk.gen.api.model.StreamType;
import org.finos.springbot.entityjson.EntityJson;
import org.finos.springbot.symphony.content.serialization.MessageMLParser;
import org.finos.springbot.symphony.conversations.SymphonyConversations;
Expand Down Expand Up @@ -51,7 +52,10 @@ public void onApplicationEvent(RealTimeEvent<V4MessageSent> t) {

EntityJson ej = jsonConverter.readValue(ms.getMessage().getData());
Message words = messageParser.apply(ms.getMessage().getMessage(), ej);
Addressable rr = ruBuilder.loadRoomById(ms.getMessage().getStream().getStreamId());
Addressable rr = null;
if(ms.getMessage().getStream().getStreamType().equals(StreamType.TypeEnum.ROOM)) {
rr = ruBuilder.loadRoomById(ms.getMessage().getStream().getStreamId());
}
User u = ruBuilder.loadUserById(ms.getMessage().getUser().getUserId());

// TODO: multi-user chat (not room)
Expand Down

0 comments on commit 714e323

Please sign in to comment.