diff --git a/ts/components/conversation/UpdateGroupMembersDialog.tsx b/ts/components/conversation/UpdateGroupMembersDialog.tsx index 99b88d48b..a152518cf 100644 --- a/ts/components/conversation/UpdateGroupMembersDialog.tsx +++ b/ts/components/conversation/UpdateGroupMembersDialog.tsx @@ -70,7 +70,7 @@ export class UpdateGroupMembersDialog extends React.Component { return null; } const lokiProfile = convo.getLokiProfile(); - const name = lokiProfile ? `${lokiProfile.displayName} (Zombie)` : window.i18n('anonymous'); + const name = lokiProfile ? lokiProfile.displayName : window.i18n('anonymous'); const existingZombie = this.props.existingZombies.includes(convo.id); return { diff --git a/ts/receiver/closedGroups.ts b/ts/receiver/closedGroups.ts index 5aae9ac61..312462def 100644 --- a/ts/receiver/closedGroups.ts +++ b/ts/receiver/closedGroups.ts @@ -44,7 +44,9 @@ export async function handleClosedGroupControlMessage( const { type } = groupUpdate; const { Type } = SignalService.DataMessage.ClosedGroupControlMessage; window.log.info( - ` handle closed group update from ${envelope.senderIdentity} about group ${envelope.source}` + ` handle closed group update from ${envelope.senderIdentity || envelope.source} about group ${ + envelope.source + }` ); if (BlockedNumberController.isGroupBlocked(PubKey.cast(envelope.source))) { @@ -210,12 +212,12 @@ export async function handleNewClosedGroup( ); // We only set group admins on group creation - const groupDetails = { + const groupDetails: ClosedGroup.GroupInfo = { id: groupId, name: name, members: members, admins, - active: true, + activeAt: Date.now(), weWereJustAdded: true, }; @@ -228,12 +230,13 @@ export async function handleNewClosedGroup( // Having that timestamp set will allow us to pickup incoming group update which were sent between // envelope.timestamp and Date.now(). And we need to listen to those (some might even remove us) convo.set('lastJoinedTimestamp', _.toNumber(envelope.timestamp)); + convo.updateLastMessage(); await convo.commit(); // sanity checks validate this // tslint:disable: no-non-null-assertion const ecKeyPair = new ECKeyPair(encryptionKeyPair!.publicKey, encryptionKeyPair!.privateKey); - window.log.info(`Received a the encryptionKeyPair for new group ${groupId}`); + window.log.info(`Received the encryptionKeyPair for new group ${groupId}`); await addClosedGroupEncryptionKeyPair(groupId, ecKeyPair.toHexKeyPair()); @@ -894,12 +897,12 @@ export async function createClosedGroup(groupName: string, members: Array; zombies?: Array; - active?: boolean; + activeAt?: number; expireTimer?: number | null; avatar?: any; color?: any; // what is this??? @@ -50,7 +50,7 @@ export interface GroupInfo { admins?: Array; secretKey?: Uint8Array; weWereJustAdded?: boolean; -} +}; interface UpdatableGroupState { name: string; @@ -113,13 +113,13 @@ export async function initiateGroupUpdate( // do not give an admins field here. We don't want to be able to update admins and // updateOrCreateClosedGroup() will update them if given the choice. - const groupDetails = { + const groupDetails: GroupInfo = { id: groupId, name: groupName, members, // remove from the zombies list the zombies not which are not in the group anymore zombies: convo.get('zombies').filter(z => members.includes(z)), - active: true, + activeAt: Date.now(), expireTimer: convo.get('expireTimer'), avatar, }; @@ -245,15 +245,10 @@ export async function updateOrCreateClosedGroup(details: GroupInfo) { is_medium_group: true, }; - if (details.active) { - const activeAt = conversation.get('active_at'); + if (details.activeAt) { + updates.active_at = details.activeAt; + updates.timestamp = updates.active_at; - // The idea is to make any new group show up in the left pane. If - // activeAt is null, then this group has been purposefully hidden. - if (activeAt !== null) { - updates.active_at = activeAt || Date.now(); - updates.timestamp = updates.active_at; - } updates.left = false; updates.lastJoinedTimestamp = weWereJustAdded ? Date.now() : updates.active_at; } else {