diff --git a/pkg/interface/src/views/apps/chat/ChatResource.tsx b/pkg/interface/src/views/apps/chat/ChatResource.tsx index 8e3aa063e..66ef13b30 100644 --- a/pkg/interface/src/views/apps/chat/ChatResource.tsx +++ b/pkg/interface/src/views/apps/chat/ChatResource.tsx @@ -139,9 +139,6 @@ export function ChatResource(props: ChatResourceProps) { return ; } - const modifiedContacts = { ...contacts }; - delete modifiedContacts[`~${window.ship}`]; - return ( { history, api, highlighted, + showOurContact, fontSize } = this.props; @@ -295,6 +296,7 @@ class ChatMessage extends Component { style, containerClass, isPending, + showOurContact, history, api, scrollWindow, @@ -355,6 +357,7 @@ export const MessageAuthor = ({ api, history, scrollWindow, + showOurContact, ...rest }) => { const osDark = useLocalState((state) => state.dark); @@ -367,7 +370,11 @@ export const MessageAuthor = ({ .unix(msg['time-sent'] / 1000) .format(DATESTAMP_FORMAT); const contact = - `~${msg.author}` in contacts ? contacts[`~${msg.author}`] : false; + ( ( (msg.author === window.ship && showOurContact) || + msg.author !== window.ship) && + `~${msg.author}` in contacts + ) ? contacts[`~${msg.author}`] : false; + const showNickname = useShowNickname(contact); const { hideAvatars } = useSettingsState(selectCalmState); const shipName = showNickname ? contact.nickname : cite(msg.author); diff --git a/pkg/interface/src/views/apps/chat/components/ChatWindow.tsx b/pkg/interface/src/views/apps/chat/components/ChatWindow.tsx index 67a19a05d..644832bc2 100644 --- a/pkg/interface/src/views/apps/chat/components/ChatWindow.tsx +++ b/pkg/interface/src/views/apps/chat/components/ChatWindow.tsx @@ -207,7 +207,7 @@ class ChatWindow extends Component< api, association, group, - contacts, + showOurContact, graph, history, groups, @@ -217,13 +217,14 @@ class ChatWindow extends Component< const messageProps = { association, group, - contacts, + showOurContact, unreadMarkerRef, history, api, groups, associations }; + const msg = graph.get(index)?.post; if (!msg) return null; if (!this.state.initialized) { @@ -254,6 +255,7 @@ class ChatWindow extends Component< msg, ...messageProps }; + return (