Fix lobby check crash, fix user related crash, fix infinite lobby progress bar

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-09-02 11:55:37 +02:00
parent 8fd9208b9e
commit 86974a8437
5 changed files with 23 additions and 31 deletions

View file

@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":109,"versionName":"7.0.0beta1","enabled":true,"outputFile":"app-gplay-release.apk","fullName":"gplayRelease","baseName":"gplay-release"},"path":"app-gplay-release.apk","properties":{}}]

View file

@ -42,7 +42,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
@ -266,18 +265,14 @@ public class ChatController extends BaseController implements MessagesListAdapte
currentConversation = roomOverall.getOcs().getData();
if (oldConversation == null) {
conversationName = currentConversation.getDisplayName();
setTitle();
setupMentionAutocomplete();
}
checkReadOnlyState();
if (oldConversation == null || (!oldConversation.getLobbyState().equals(currentConversation.getLobbyState()) || !oldConversation.getLobbyTimer().equals(currentConversation.getLobbyTimer()))) {
checkLobbyState(oldConversation != null && (!oldConversation.getLobbyState().equals(currentConversation.getLobbyState())));
}
checkLobbyState();
if (oldConversation == null) {
if (oldConversation == null || oldConversation.getRoomId() == null) {
joinRoomWithPassword();
}
@ -317,7 +312,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
if (roomId.equals(conversation.getRoomId())) {
roomToken = conversation.getToken();
currentConversation = conversation;
checkLobbyState(false);
checkLobbyState();
checkReadOnlyState();
conversationName = conversation.getDisplayName();
setTitle();
@ -488,7 +483,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
}
if (currentConversation != null) {
checkLobbyState(false);
checkLobbyState();
}
if (adapterWasNull) {
@ -535,8 +530,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
}
}
private void checkLobbyState(boolean lobbyStateChanged) {
if (currentConversation != null) {
private void checkLobbyState() {
if (currentConversation != null && currentConversation.isLobbyViewApplicable(conversationUser)) {
if (!checkingLobbyStatus) {
getRoomInfo();
@ -548,7 +543,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
messageInputView.setVisibility(View.GONE);
loadingProgressBar.setVisibility(View.GONE);
if (currentConversation.getLobbyTimer() != null && currentConversation.getLobbyTimer() != 0) {
if (currentConversation.getLobbyTimer() != null && currentConversation.getLobbyTimer() != 0L) {
conversationLobbyText.setText(String.format(getResources().getString(R.string.nc_lobby_waiting_with_date), DateUtils.INSTANCE.getLocalDateStringFromTimestampForLobby(currentConversation.getLobbyTimer())));
} else {
conversationLobbyText.setText(R.string.nc_lobby_waiting);
@ -557,15 +552,16 @@ public class ChatController extends BaseController implements MessagesListAdapte
lobbyView.setVisibility(View.GONE);
messagesListView.setVisibility(View.VISIBLE);
messageInput.setVisibility(View.VISIBLE);
if (lobbyStateChanged) {
loadingProgressBar.setVisibility(View.VISIBLE);
if (isFirstMessagesProcessing) {
pullChatMessages(0);
} else {
pullChatMessages(1);
}
}
}
} else {
lobbyView.setVisibility(View.GONE);
messagesListView.setVisibility(View.VISIBLE);
messageInput.setVisibility(View.VISIBLE);
}
}
@ -764,7 +760,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
ApplicationWideCurrentRoomHolder.getInstance().setSession(currentCall.getSessionId());
startPing();
checkLobbyState(false);
checkLobbyState();
setupWebsocket();
@ -988,7 +984,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
@Override
public void onComplete() {
if (currentConversation.shouldShowLobby(conversationUser)) {
if (!currentConversation.shouldShowLobby(conversationUser)) {
pullChatMessages(1);
}
}

View file

@ -114,7 +114,7 @@ public class Conversation {
}
public boolean shouldShowLobby(UserEntity conversationUser) {
return getLobbyState().equals(LobbyState.LOBBY_STATE_MODERATORS_ONLY) && !canModerate(conversationUser);
return LobbyState.LOBBY_STATE_MODERATORS_ONLY.equals(getLobbyState()) && !canModerate(conversationUser);
}
public boolean isLobbyViewApplicable(UserEntity conversationUser) {

View file

@ -38,7 +38,7 @@
android:tint="@color/colorPrimary"
android:visibility="gone" />
<EmojiTextView
<androidx.emoji.widget.EmojiTextView
android:id="@+id/name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -273,8 +273,6 @@
<string name="nc_guest">Guest</string>
<string name="nc_following_link">User following a public link</string>
<string name="nc_readonly_hint">This conversation is locked</string>
<!-- Browser component -->
<string name="nc_file_browser">File browser"</string>
<string name="nc_select_files">Select files</string>
@ -291,7 +289,4 @@
<string name="nc_lobby_waiting_with_date">You are currently waiting in the lobby.\n This
meeting is scheduled for %1$s.</string>
<string name="nc_manual">Manual</string>
<string name="nc_at">at</string>
</resources>