Skip to content

Commit

Permalink
refactor conversation name to display name
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Sep 11, 2024
1 parent 946fb17 commit c478cb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion meshchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ async def index(request):

# add to conversations
conversations.append({
"name": self.get_lxmf_conversation_name(other_user_hash),
"display_name": self.get_lxmf_conversation_name(other_user_hash),
"destination_hash": other_user_hash,
"is_unread": self.is_lxmf_conversation_unread(other_user_hash),
"failed_messages_count": self.lxmf_conversation_failed_messages_count(other_user_hash),
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/messages/MessagesPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default {
// we didn't find an existing peer, so just use an unknown name
this.onPeerClick({
name: "Unknown Peer",
display_name: "Unknown Peer",
destination_hash: destinationHash,
});
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/components/messages/MessagesSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
</div>
<div class="mr-auto">
<div class="text-gray-900" :class="{ 'font-semibold': conversation.is_unread || conversation.failed_messages_count > 0 }">{{ conversation.name }}</div>
<div class="text-gray-900" :class="{ 'font-semibold': conversation.is_unread || conversation.failed_messages_count > 0 }">{{ conversation.display_name }}</div>
<div class="text-gray-500 text-sm">{{ formatTimeAgo(conversation.updated_at) }}</div>
</div>
<div v-if="conversation.is_unread" class="my-auto ml-2 mr-2">
Expand Down Expand Up @@ -160,9 +160,9 @@ export default {
searchedConversations() {
return this.conversations.filter((conversation) => {
const search = this.conversationsSearchTerm.toLowerCase();
const matchesName = conversation.name.toLowerCase().includes(search);
const matchesDisplayName = conversation.display_name.toLowerCase().includes(search);
const matchesDestinationHash = conversation.destination_hash.toLowerCase().includes(search);
return matchesName || matchesDestinationHash;
return matchesDisplayName || matchesDestinationHash;
});
},
peersCount() {
Expand Down

0 comments on commit c478cb1

Please sign in to comment.