mirror of
https://github.com/urbit/shrub.git
synced 2025-01-02 01:25:55 +03:00
Merge pull request #2557 from urbit/mp/chat/sidebar-nicks
chat: sidebar pulls nickname from associated group
This commit is contained in:
commit
65404276b8
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user