You can use the streams service to get room info, then extract the room name in the roomAttributes
object.
BDK 2.0:
bdk.datafeed().subscribe(new RealTimeEventListener() {
@Override
public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
String streamId = event.getMessage().getStream().getStreamId();
String roomName = bdk.streams().getRoomInfo(streamId).getRoomAttributes().getName();
bdk.messages().send(streamId, "Hello in room: " + roomName);
}
}
SDK:
String streamId = msg.getStream().getStreamId();
String roomName = botClient.getStreamsClient()
.getRoomInfo(streamId).getRoomAttributes().getName();
this.botClient.getMessagesClient().sendMessage(streamId,
new OutboundMessage("Hello in room: " + roomName));
You can filter the payload to only include the rooms via parmaters such as "active": true,
by modofying the body json: