mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Fix a crash in conversation info
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
eb66c97fe9
commit
60d19bc658
@ -363,78 +363,82 @@ public class ConversationInfoController extends BaseController {
|
|||||||
public void onNext(RoomOverall roomOverall) {
|
public void onNext(RoomOverall roomOverall) {
|
||||||
conversation = roomOverall.getOcs().getData();
|
conversation = roomOverall.getOcs().getData();
|
||||||
|
|
||||||
ownOptionsCategory.setVisibility(View.VISIBLE);
|
if (isAttached() && (!isBeingDestroyed() || !isDestroyed())) {
|
||||||
|
ownOptionsCategory.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if (!conversation.canLeave(conversationUser)) {
|
if (leaveConversationAction != null) {
|
||||||
leaveConversationAction.setVisibility(View.GONE);
|
if (!conversation.canLeave(conversationUser)) {
|
||||||
} else {
|
leaveConversationAction.setVisibility(View.GONE);
|
||||||
leaveConversationAction.setVisibility(View.VISIBLE);
|
} else {
|
||||||
}
|
leaveConversationAction.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
if (!conversation.canModerate(conversationUser)) {
|
|
||||||
deleteConversationAction.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
deleteConversationAction.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Conversation.ConversationType.ROOM_SYSTEM.equals(conversation.getType())) {
|
|
||||||
muteCalls.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
getListOfParticipants();
|
|
||||||
|
|
||||||
if (progressBar != null) {
|
|
||||||
progressBar.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nameCategoryView != null) {
|
|
||||||
nameCategoryView.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (conversationDisplayName != null) {
|
|
||||||
conversationDisplayName.setText(conversation.getDisplayName());
|
|
||||||
}
|
|
||||||
|
|
||||||
loadConversationAvatar();
|
|
||||||
|
|
||||||
if (conversationUser.hasSpreedCapabilityWithName("notification-levels")) {
|
|
||||||
if (messageNotificationLevel != null) {
|
|
||||||
messageNotificationLevel.setEnabled(true);
|
|
||||||
messageNotificationLevel.setAlpha(1.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conversation.getNotificationLevel().equals(Conversation.NotificationLevel.DEFAULT)) {
|
if (!conversation.canModerate(conversationUser)) {
|
||||||
String stringValue;
|
deleteConversationAction.setVisibility(View.GONE);
|
||||||
switch (new EnumNotificationLevelConverter().convertToInt(conversation.getNotificationLevel())) {
|
} else {
|
||||||
case 1:
|
deleteConversationAction.setVisibility(View.VISIBLE);
|
||||||
stringValue = "always";
|
}
|
||||||
break;
|
|
||||||
case 2:
|
if (Conversation.ConversationType.ROOM_SYSTEM.equals(conversation.getType())) {
|
||||||
stringValue = "mention";
|
muteCalls.setVisibility(View.GONE);
|
||||||
break;
|
}
|
||||||
case 3:
|
|
||||||
stringValue = "never";
|
getListOfParticipants();
|
||||||
break;
|
|
||||||
default:
|
if (progressBar != null) {
|
||||||
stringValue = "mention";
|
progressBar.setVisibility(View.GONE);
|
||||||
break;
|
}
|
||||||
|
|
||||||
|
if (nameCategoryView != null) {
|
||||||
|
nameCategoryView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conversationDisplayName != null) {
|
||||||
|
conversationDisplayName.setText(conversation.getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
loadConversationAvatar();
|
||||||
|
|
||||||
|
if (conversationUser.hasSpreedCapabilityWithName("notification-levels")) {
|
||||||
|
if (messageNotificationLevel != null) {
|
||||||
|
messageNotificationLevel.setEnabled(true);
|
||||||
|
messageNotificationLevel.setAlpha(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageNotificationLevel != null) {
|
if (!conversation.getNotificationLevel().equals(Conversation.NotificationLevel.DEFAULT)) {
|
||||||
messageNotificationLevel.setValue(stringValue);
|
String stringValue;
|
||||||
|
switch (new EnumNotificationLevelConverter().convertToInt(conversation.getNotificationLevel())) {
|
||||||
|
case 1:
|
||||||
|
stringValue = "always";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
stringValue = "mention";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
stringValue = "never";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
stringValue = "mention";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (messageNotificationLevel != null) {
|
||||||
|
messageNotificationLevel.setValue(stringValue);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setProperNotificationValue(conversation);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (messageNotificationLevel != null) {
|
||||||
|
messageNotificationLevel.setEnabled(false);
|
||||||
|
messageNotificationLevel.setAlpha(0.38f);
|
||||||
|
}
|
||||||
setProperNotificationValue(conversation);
|
setProperNotificationValue(conversation);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (messageNotificationLevel != null) {
|
|
||||||
messageNotificationLevel.setEnabled(false);
|
|
||||||
messageNotificationLevel.setAlpha(0.38f);
|
|
||||||
}
|
|
||||||
setProperNotificationValue(conversation);
|
|
||||||
}
|
|
||||||
|
|
||||||
materialPreferenceScreen.setVisibility(View.VISIBLE);
|
materialPreferenceScreen.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user