From 65d593cd20900c62b41168ea1fcec420366d2c77 Mon Sep 17 00:00:00 2001 From: emdee Date: Mon, 11 Dec 2023 15:39:28 +0000 Subject: [PATCH] status-message --- README.md | 5 +++-- toxygen/contacts/group_chat.py | 6 ++++-- toxygen/groups/group_peer.py | 10 ++++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2b53352..eebbfe4 100644 --- a/README.md +++ b/README.md @@ -82,5 +82,6 @@ so you can have Tox, IRC and XMPP in the same application! Work on Tox on this project is suspended until the [MultiDevice](https://git.plastiras.org/emdee/tox_profile/wiki/MultiDevice-Announcements-POC) problem is solved. Fork me! -Work on Tox on this project is stopped because Qt5 is EOL. -https://linuxreviews.org/KDE_Is_Now_Offering_A_Qt_5.15_LTS_Branch_Patch-set_For_The_Free_Software_Community +This will probably be ported to Qt6 using qtpy +https://github.com/spyder-ide/qtpy . + diff --git a/toxygen/contacts/group_chat.py b/toxygen/contacts/group_chat.py index f954894..764c6b3 100644 --- a/toxygen/contacts/group_chat.py +++ b/toxygen/contacts/group_chat.py @@ -84,13 +84,15 @@ class GroupChat(contact.Contact, ToxSave): LOG_WARN(f"add_peer id={peer_id} > {self._peers_limit}") return - LOG_TRACE(f"add_peer id={peer_id}") + status_message = f"From {self.name}" + LOG_TRACE(f"GC.add_peer id={peer_id} status_message={status_message}") peer = GroupChatPeer(peer_id, self._tox.group_peer_get_name(self._number, peer_id), self._tox.group_peer_get_status(self._number, peer_id), self._tox.group_peer_get_role(self._number, peer_id), self._tox.group_peer_get_public_key(self._number, peer_id), - is_current_user) + is_current_user, + status_message=status_message) self._peers.append(peer) def remove_peer(self, peer_id): diff --git a/toxygen/groups/group_peer.py b/toxygen/groups/group_peer.py index 65d1726..cb05fcb 100644 --- a/toxygen/groups/group_peer.py +++ b/toxygen/groups/group_peer.py @@ -5,16 +5,17 @@ class GroupChatPeer: Represents peer in group chat. """ - def __init__(self, peer_id, name, status, role, public_key, is_current_user=False, is_muted=False): + def __init__(self, peer_id, name, status, role, public_key, is_current_user=False, is_muted=False, status_message=None): self._peer_id = peer_id self._name = name self._status = status + self._status_message = status_message self._role = role self._public_key = public_key self._is_current_user = is_current_user self._is_muted = is_muted - # unused? self._kind = 'grouppeer' + # Readonly properties def get_id(self): @@ -32,6 +33,11 @@ class GroupChatPeer: is_current_user = property(get_is_current_user) + def get_status_message(self): + return self._peer_status_message + + status_message = property(get_status_message) + # Read-write properties def get_name(self):