def start_chat(self, contact_id): participant = User.getUserById(contact_id) if Chat.getChatByParticipants(self.current_user, participant): self.current_chat = Chat.getChatByParticipants(self.current_user, participant) else: chat_id = self.current_user.startChat(participant) self.current_chat = Chat.getChatById(chat_id)
def start_chat(self, contact_id): participant = User.getUserById(contact_id) chat_id = self.current_user.startChat(participant) self.current_chat = Chat.getChatById(chat_id)