Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Example 72: Redraw buddy list to include new or read 'new' notification.

  • Loading branch information...
commit d92f80b17ea18409e76cb84c6915eef59aa6c1d2 1 parent 92410d4
@buchuki authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 orkiv/__main__.py
View
5 orkiv/__main__.py
@@ -175,6 +175,8 @@ def get_chat_window(self, jabber_id):
def show_buddy_chat(self, jabber_id):
self.remove_widget(self.buddy_list)
self.add_widget(self.get_chat_window(jabber_id))
+ self.buddy_list.new_messages.discard(jabber_id)
+ self.buddy_list.force_list_view_update()
def handle_xmpp_message(self, message):
if message['type'] not in ['normal', 'chat']:
@@ -184,6 +186,9 @@ def handle_xmpp_message(self, message):
chat_window = self.get_chat_window(jabber_id)
chat_window.append_chat_message(jabber_id, message['body'], color="aaaaff")
self.in_sound.play()
+ if chat_window not in self.children:
+ self.buddy_list.new_messages.add(jabber_id)
+ self.buddy_list.force_list_view_update()
class Orkiv(App):
Please sign in to comment.
Something went wrong with that request. Please try again.