Fake that we’re still in a room when visiting conversation info

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-12-17 19:31:18 +01:00
parent c25a8b0fed
commit da779190ed
2 changed files with 11 additions and 2 deletions

View File

@ -173,6 +173,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
private static final byte CONTENT_TYPE_SYSTEM_MESSAGE = 1;
private boolean wasDetached;
private boolean isStartingACall;
public ChatController(Bundle args) {
super(args);
@ -511,6 +512,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
joinRoomWithPassword();
}
}
isStartingACall = false;
}
@Override
@ -519,7 +522,9 @@ public class ChatController extends BaseController implements MessagesListAdapte
if (conversationUser.hasSpreedCapabilityWithName("no-ping")
&& getActivity() != null && !getActivity().isChangingConfigurations()) {
wasDetached = true;
leaveRoom();
if (!isStartingACall) {
leaveRoom();
}
}
}
@ -1015,11 +1020,13 @@ public class ChatController extends BaseController implements MessagesListAdapte
if (!isVoiceOnlyCall) {
Intent videoCallIntent = getIntentForCall(false);
if (videoCallIntent != null) {
isStartingACall = true;
startActivity(videoCallIntent);
}
} else {
Intent voiceCallIntent = getIntentForCall(true);
if (voiceCallIntent != null) {
isStartingACall = true;
startActivity(voiceCallIntent);
}
}

View File

@ -118,7 +118,7 @@ public class ConversationInfoController extends BaseController {
private FlexibleAdapter<AbstractFlexibleItem> adapter;
private List<AbstractFlexibleItem> recyclerViewItems = new ArrayList<>();
public ConversationInfoController(Bundle args) {
ConversationInfoController(Bundle args) {
super(args);
setHasOptionsMenu(true);
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
@ -192,6 +192,8 @@ public class ConversationInfoController extends BaseController {
userItem.setEnabled(!participant.getSessionId().equals("0"));
if (!TextUtils.isEmpty(participant.getUserId()) && participant.getUserId().equals(conversationUser.getUserId())) {
ownUserItem = userItem;
userItem.getModel().setSessionId("-1");
userItem.setEnabled(true);
} else {
recyclerViewItems.add(userItem);
}