Skip to content

Commit

Permalink
fix: migrate remote parties away from roster name + add todo otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Nov 3, 2023
1 parent 739b131 commit 8b26d72
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/assemblies/inbox/InboxTopbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ export default {
return {
type: PopoverItemType.Button,
icon: "clock",

// TODO: migrate to client-provided room name
label: Store.$roster.getEntryName(new JID(historyRoomID)),

click: () => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/base/BaseAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ export default {
},

rosterName(): ReturnType<typeof Store.$roster.getEntryName> {
// TODO: migrate to client-provided name (do not source from roster \
// anymore, might return jid-based nickname)
return Store.$roster.getEntryName(this.jid);
}
},
Expand Down
18 changes: 14 additions & 4 deletions src/components/inbox/InboxMessaging.vue
Original file line number Diff line number Diff line change
Expand Up @@ -428,23 +428,29 @@ export default {
identifyPartyLocal(runtime: MessagingRuntime): void {
// Identify local party
runtime.MessagingStore.identify(this.selfJID.toString(), {
// TODO: migrate to client-provided self name (do not source from \
// roster anymore, returns jid-based nickname)
name: Store.$roster.getEntryName(this.selfJID),
avatar: Store.$avatar.getAvatarDataUrl(this.selfJID)
});
},

identifyPartyRemote(runtime: MessagingRuntime, jid: JID): void {
identifyPartyRemote(
runtime: MessagingRuntime,
jid: JID,
name: string
): void {
// Identify remote party
runtime.MessagingStore.identify(jid.toString(), {
name: Store.$roster.getEntryName(jid),
name,
avatar: Store.$avatar.getAvatarDataUrl(jid)
});
},

identifyAllPartiesRemote(runtime: MessagingRuntime): void {
// Identify remote all parties
this.room?.members.forEach(member => {
this.identifyPartyRemote(runtime, member.jid);
this.identifyPartyRemote(runtime, member.jid, member.name);
});
},

Expand Down Expand Up @@ -981,7 +987,11 @@ export default {
});

if (remotePartyMember) {
this.identifyPartyRemote(frameRuntime, remotePartyMember.jid);
this.identifyPartyRemote(
frameRuntime,
remotePartyMember.jid,
remotePartyMember.name
);
}

// Re-identify local party?
Expand Down

0 comments on commit 8b26d72

Please sign in to comment.