Merge pull request #2479 from Bilb/fix-sogs-no-displayname
fix: show sogs without display name in convo list
This commit is contained in:
commit
f6c6fe01a4
|
@ -1514,6 +1514,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
||||||
details: {
|
details: {
|
||||||
admins?: Array<string>;
|
admins?: Array<string>;
|
||||||
image_id?: number;
|
image_id?: number;
|
||||||
|
name?: string;
|
||||||
moderators?: Array<string>;
|
moderators?: Array<string>;
|
||||||
hidden_admins?: Array<string>;
|
hidden_admins?: Array<string>;
|
||||||
hidden_moderators?: Array<string>;
|
hidden_moderators?: Array<string>;
|
||||||
|
@ -1562,6 +1563,11 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
||||||
type: 'mods',
|
type: 'mods',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (details.name && details.name !== this.getRealSessionUsername()) {
|
||||||
|
hasChange = hasChange || true;
|
||||||
|
this.setSessionDisplayNameNoCommit(details.name);
|
||||||
|
}
|
||||||
|
|
||||||
hasChange = hasChange || modsChanged;
|
hasChange = hasChange || modsChanged;
|
||||||
|
|
||||||
if (this.isOpenGroupV2() && details.image_id && isNumber(details.image_id)) {
|
if (this.isOpenGroupV2() && details.image_id && isNumber(details.image_id)) {
|
||||||
|
|
|
@ -134,6 +134,10 @@ export async function joinOpenGroupV2WithUIEvents(
|
||||||
const alreadyExist = hasExistingOpenGroup(parsedRoom.serverUrl, parsedRoom.roomId);
|
const alreadyExist = hasExistingOpenGroup(parsedRoom.serverUrl, parsedRoom.roomId);
|
||||||
const conversationID = getOpenGroupV2ConversationId(parsedRoom.serverUrl, parsedRoom.roomId);
|
const conversationID = getOpenGroupV2ConversationId(parsedRoom.serverUrl, parsedRoom.roomId);
|
||||||
if (alreadyExist || getConversationController().get(conversationID)) {
|
if (alreadyExist || getConversationController().get(conversationID)) {
|
||||||
|
const existingConvo = getConversationController().get(conversationID);
|
||||||
|
await existingConvo.setDidApproveMe(true, false);
|
||||||
|
await existingConvo.setIsApproved(true, false);
|
||||||
|
await existingConvo.commit();
|
||||||
if (showToasts) {
|
if (showToasts) {
|
||||||
ToastUtils.pushToastError('publicChatExists', window.i18n('publicChatExists'));
|
ToastUtils.pushToastError('publicChatExists', window.i18n('publicChatExists'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,6 +197,8 @@ export class OpenGroupManagerV2 {
|
||||||
active_at: Date.now(),
|
active_at: Date.now(),
|
||||||
displayNameInProfile: room.roomName,
|
displayNameInProfile: room.roomName,
|
||||||
isApproved: true,
|
isApproved: true,
|
||||||
|
didApproveMe: true,
|
||||||
|
isTrustedForAttachmentDownload: true, // we always trust attachments when sent to an opengroup
|
||||||
});
|
});
|
||||||
await conversation.commit();
|
await conversation.commit();
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ async function handlePollInfoResponse(
|
||||||
details: {
|
details: {
|
||||||
admins?: Array<string>;
|
admins?: Array<string>;
|
||||||
image_id: number;
|
image_id: number;
|
||||||
|
name?: string;
|
||||||
moderators?: Array<string>;
|
moderators?: Array<string>;
|
||||||
hidden_admins?: Array<string>;
|
hidden_admins?: Array<string>;
|
||||||
hidden_moderators?: Array<string>;
|
hidden_moderators?: Array<string>;
|
||||||
|
@ -122,7 +123,8 @@ async function handlePollInfoResponse(
|
||||||
'image_id',
|
'image_id',
|
||||||
'moderators',
|
'moderators',
|
||||||
'hidden_admins',
|
'hidden_admins',
|
||||||
'hidden_moderators'
|
'hidden_moderators',
|
||||||
|
'name'
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -419,14 +419,6 @@ export const _getSortedConversations = (
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Open Group to list as soon as the name has been set
|
|
||||||
if (
|
|
||||||
conversation.isPublic &&
|
|
||||||
(!conversation.displayNameInProfile || conversation.displayNameInProfile === 'Unknown group')
|
|
||||||
) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove all invalid conversations and conversatons of devices associated
|
// Remove all invalid conversations and conversatons of devices associated
|
||||||
// with cancelled attempted links
|
// with cancelled attempted links
|
||||||
if (!conversation.isPublic && !conversation.activeAt) {
|
if (!conversation.isPublic && !conversation.activeAt) {
|
||||||
|
|
Loading…
Reference in New Issue