added received indicator

a * will appear by the name that received the message
if the name is unknown then the * will appear by 'other'

this currently only works for XMMP/Jabber acounts
the sender has the part before the / extracted thus
user@example.com/testing becomes user@example.com
then this sender is checked againt the list of all
accounts for the user
This commit is contained in:
Fredrick W. Warren 2025-02-26 14:42:57 -07:00
parent 2af30f8659
commit 8d879ad4a5

View File

@ -36,13 +36,12 @@ class Application(wmoo.Application):
self._count = 0
self._flasher = 0
self.backlit = 0
self.lines = [ # name, messages received
[" CATHY", 0],
[" FRANK", 0],
[" TIM", 0],
[" LEE", 0],
[" TANDA", 0],
[" OTHER", 0],
self.lines = [ # name, messages received, accounts
[" CATHY", 0, ['cathy@example.com']],
[" FRANK", 0, ['frank@example.com']],
[" TIM", 0, ['tim@example.com']],
[" LEE", 0, ['lee@example.com']],
[" OTHER", 0, ['']],
]
# Initialize D-Bus and connect to Pidgin's ReceivedIMMsg signal
self.register_dbus()
@ -98,6 +97,13 @@ class Application(wmoo.Application):
conversation (str): The conversation identifier.
flags (int): Message flags.
"""
# find who the message is for or return OTHER
self.lines[-1][0] = '* OTHER'
for line in self.lines[:-1]:
if sender.split('/')[0] in line[2]:
line[0] = '*' + line[0][1:]
self.lines[-1][0] = ' OTHER'
ic("")
ic(f"sender: {sender}")
ic(f"message: {message}")
@ -211,7 +217,12 @@ class Application(wmoo.Application):
"""
Turn of backlite and zero out messages
"""
# clear out text
for line in self.lines:
line[0] = ' ' + line[0][1:]
self.backlite_off()
self.update()
def handle_buttonrelease(self, event):
"""