def while_waiting(self): current_user = self.chatBoxObj.value client.client.sync_updates() if client.need_update_message: if client.need_update_current_user == current_user: self.messageBoxObj.update_messages(current_user) client.read_all_messages(current_user) client.dialogs[current_user].unread_count = 0 self.chatBoxObj.update_chat() client.need_update_message = 0 client.need_update_current_user = -1 if client.need_update_online: if client.need_update_current_user == current_user: self.messageBoxObj.update_messages(current_user) self.chatBoxObj.update_chat() client.need_update_current_user = -1 client.need_update_online = 0 if client.need_update_read_messages: if client.need_update_current_user == current_user: self.messageBoxObj.update_messages(current_user) client.need_update_current_user = -1 client.need_update_read_messages = 0
def event_chat_select(self, event): current_user = self.chatBoxObj.value client.dialogs[current_user].unread_count = 0 self.chatBoxObj.update_chat() self.messageBoxObj.update_messages(current_user) client.read_all_messages(current_user)