mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-27 16:10:32 +00:00
show lxmf user icons in messages announce list
This commit is contained in:
parent
bb62b3331f
commit
a689fcf6f3
2 changed files with 15 additions and 1 deletions
11
meshchat.py
11
meshchat.py
|
|
@ -2009,6 +2009,16 @@ class ReticulumMeshChat:
|
|||
elif announce.aspect == "nomadnetwork.node":
|
||||
display_name = self.parse_nomadnetwork_node_display_name(announce.app_data)
|
||||
|
||||
# find lxmf user icon from database
|
||||
lxmf_user_icon = None
|
||||
db_lxmf_user_icon = database.LxmfUserIcon.get_or_none(database.LxmfUserIcon.destination_hash == announce.destination_hash)
|
||||
if db_lxmf_user_icon is not None:
|
||||
lxmf_user_icon = {
|
||||
"icon_name": db_lxmf_user_icon.icon_name,
|
||||
"foreground_colour": db_lxmf_user_icon.foreground_colour,
|
||||
"background_colour": db_lxmf_user_icon.background_colour,
|
||||
}
|
||||
|
||||
return {
|
||||
"id": announce.id,
|
||||
"destination_hash": announce.destination_hash,
|
||||
|
|
@ -2018,6 +2028,7 @@ class ReticulumMeshChat:
|
|||
"app_data": announce.app_data,
|
||||
"display_name": display_name,
|
||||
"custom_display_name": self.get_custom_destination_display_name(announce.destination_hash),
|
||||
"lxmf_user_icon": lxmf_user_icon,
|
||||
"created_at": announce.created_at,
|
||||
"updated_at": announce.updated_at,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,10 @@
|
|||
<div v-if="searchedPeers.length > 0" class="w-full">
|
||||
<div @click="onPeerClick(peer)" v-for="peer of searchedPeers" class="flex cursor-pointer p-2 border-l-2" :class="[ peer.destination_hash === selectedDestinationHash ? 'bg-gray-100 dark:bg-zinc-700 border-blue-500 dark:border-blue-400' : 'bg-white dark:bg-zinc-950 border-transparent hover:bg-gray-50 dark:hover:bg-zinc-700 hover:border-gray-200 dark:hover:border-zinc-600' ]">
|
||||
<div class="my-auto mr-2">
|
||||
<div class="bg-gray-200 dark:bg-zinc-700 text-gray-500 dark:text-gray-400 p-2 rounded">
|
||||
<div v-if="peer.lxmf_user_icon" class="p-2 rounded" :style="{ 'color': peer.lxmf_user_icon.foreground_colour, 'background-color': peer.lxmf_user_icon.background_colour }">
|
||||
<MaterialDesignIcon :icon-name="peer.lxmf_user_icon.icon_name" class="w-6 h-6"/>
|
||||
</div>
|
||||
<div v-else class="bg-gray-200 dark:bg-zinc-700 text-gray-500 dark:text-gray-400 p-2 rounded">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" />
|
||||
</svg>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue