def createRoomWithIds(self, ids=[]): """Create a chat room with contact ids""" try: room = LineRoom(self, self._createRoom(ids)) self.rooms.append(room) return room except Exception as e: self.raise_error(e) return None
def createRoomWithContacts(self, contacts=[]): """Create a chat room with contacts""" try: contact_ids = [] for contact in contacts: contact_ids.append(contact.id) room = LineRoom(self, self._createRoom(contact_ids)) self.rooms.append(room) return room except Exception as e: self.raise_error(e) return None
def refreshActiveRooms(self): """Refresh active chat rooms""" start = 1 count = 50 self.rooms = [] while True: channel = self._getMessageBoxCompactWrapUpList(start, count) for box in channel.messageBoxWrapUpList: if box.messageBox.midType == ToType.ROOM: room = LineRoom(self, self._getRoom(box.messageBox.id)) self.rooms.append(room) if len(channel.messageBoxWrapUpList) == count: start += count else: break