mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-31 19:42:34 +00:00
Fix guest author location
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
328c8e0c2d
commit
6b204b5165
@ -157,6 +157,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
private boolean wasDetached;
|
||||
private EmojiPopup emojiPopup;
|
||||
|
||||
private CharSequence myFirstMessage;
|
||||
|
||||
public ChatController(Bundle args) {
|
||||
super(args);
|
||||
setHasOptionsMenu(true);
|
||||
@ -675,6 +677,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
|
||||
@Override
|
||||
public void onNext(GenericOverall genericOverall) {
|
||||
myFirstMessage = message;
|
||||
|
||||
if (popupBubble != null && popupBubble.isShown()) {
|
||||
popupBubble.hide();
|
||||
}
|
||||
@ -689,6 +693,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
if (e instanceof HttpException) {
|
||||
int code = ((HttpException) e).code();
|
||||
if (Integer.toString(code).startsWith("2")) {
|
||||
myFirstMessage = message;
|
||||
|
||||
if (popupBubble != null && popupBubble.isShown()) {
|
||||
popupBubble.hide();
|
||||
}
|
||||
@ -878,6 +884,13 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
chatMessage.setBaseUrl(conversationUser.getBaseUrl());
|
||||
chatMessageList.get(i).setActiveUserId(conversationUser.getUserId());
|
||||
|
||||
if (conversationUser.getUserId().equals("?") && !TextUtils.isEmpty(myFirstMessage.toString())) {
|
||||
if (chatMessage.getActorType().equals("guests")) {
|
||||
conversationUser.setUserId(chatMessage.getActorId());
|
||||
setSenderId();
|
||||
}
|
||||
}
|
||||
|
||||
boolean shouldScroll = layoutManager.findFirstVisibleItemPosition() == 0 ||
|
||||
(adapter != null && adapter.getItemCount() == 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user