mirror of
https://codeberg.org/Mercury-IM/Mercury-IM
synced 2024-06-18 09:34:52 +02:00
Reformat
This commit is contained in:
parent
4491df0dd3
commit
875321ed00
|
@ -75,14 +75,13 @@ public class XmppGroupChatRepository
|
|||
@Override
|
||||
public Single<GroupChat> getOrCreateGroupChat(Account account, String roomAddress) {
|
||||
return getGroupChatByRoomAddress(account, roomAddress)
|
||||
.switchIfEmpty(
|
||||
Single.just(new IGroupChat())
|
||||
.map(chat -> {
|
||||
chat.setAccount(account);
|
||||
chat.setRoomAddress(roomAddress);
|
||||
return chat;
|
||||
})
|
||||
.flatMap(this::insertGroupChat))
|
||||
.switchIfEmpty(Single.just(new IGroupChat())
|
||||
.map(chat -> {
|
||||
chat.setAccount(account);
|
||||
chat.setRoomAddress(roomAddress);
|
||||
return chat;
|
||||
})
|
||||
.flatMap(this::insertGroupChat))
|
||||
.subscribeOn(subscriberScheduler())
|
||||
.observeOn(observerScheduler());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue