Merge pull request #2557 from urbit/mp/chat/sidebar-nicks

chat: sidebar pulls nickname from associated group
This commit is contained in:
Fang 2020-03-19 17:28:03 +01:00 committed by GitHub
commit 65404276b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,6 +40,7 @@ export class Sidebar extends Component {
let when = !!msg ? msg.when : 0;
let title = box.substr(1);
let associatedGroup = box;
if (
box in props.associations["chat"] &&
props.associations.chat[box].metadata
@ -47,13 +48,17 @@ export class Sidebar extends Component {
title = props.associations.chat[box].metadata.title
? props.associations.chat[box].metadata.title
: box.substr(1);
associatedGroup = props.associations.chat[box]["group-path"]
? props.associations.chat[box]["group-path"]
: box;
}
let nickname = author;
if (box in props.contacts && author in props.contacts[box]) {
nickname = props.contacts[box][author].nickname
? props.contacts[box][author].nickname
: author;
if (associatedGroup in props.contacts &&
author in props.contacts[associatedGroup]) {
nickname = props.contacts[associatedGroup][author].nickname
? props.contacts[associatedGroup][author].nickname
: author;
}
return {