async def added_to_room(self, sender: ChatServerProcessor, user_id: int, room: models.Room): user_processors = self.__clients.get(user_id) if not user_processors: return for user_processor in user_processors: self.add_to_rooms(user_processor, room.id) response = self._make_system_message(sender, SystemMessage.ADDED_TO_ROOM, room=room.client_data()) await self._send_message(user_processors, response, sender)
async def added_contact(self, current: ChatServerProcessor, receiver_id: int, contact_id: int, user: models.User, room: models.Room): user_processors = self.__clients.get(receiver_id) if not user_processors: return for user_processor in user_processors: self.add_to_rooms(user_processor, room.id) response = self._make_system_message( current, SystemMessage.ADDED_CONTACT, contact_id=contact_id, user=user.chat_client_data().to_dict_friend(), room=room.client_data()) await self._send_message(user_processors, response, current)