_summary_ Args: msg (Optional[str], optional): _description_. Defaults to None. contact_id (Optional[str], optional): _description_. Defaults to None. room_id (Optional[str], optional): _description_. Defaults to None. Returns: str: _
(
self,
msg: Optional[str] = None,
contact_id: Optional[str] = None,
room_id: Optional[str] = None
)
| 275 | return message.id |
| 276 | |
| 277 | def add_random_fake_room_message( |
| 278 | self, |
| 279 | msg: Optional[str] = None, |
| 280 | contact_id: Optional[str] = None, |
| 281 | room_id: Optional[str] = None |
| 282 | ) -> str: |
| 283 | """_summary_ |
| 284 | |
| 285 | Args: |
| 286 | msg (Optional[str], optional): _description_. Defaults to None. |
| 287 | contact_id (Optional[str], optional): _description_. Defaults to None. |
| 288 | room_id (Optional[str], optional): _description_. Defaults to None. |
| 289 | |
| 290 | Returns: |
| 291 | str: _description_ |
| 292 | """ |
| 293 | if not msg: |
| 294 | msg = str(uuid4()) |
| 295 | if not contact_id and not room_id: |
| 296 | payload: RoomPayload = random.choice(self._room_payloads.values()) |
| 297 | room_id = payload.id |
| 298 | contact_id = random.choice(payload.member_ids) |
| 299 | elif contact_id: |
| 300 | for payload in self._room_payloads.values(): |
| 301 | if contact_id in payload.member_ids: |
| 302 | room_id = payload.id |
| 303 | break |
| 304 | elif room_id: |
| 305 | contact_id = self.get_fake_room(room_id).member_ids[0] |
| 306 | |
| 307 | message_payload = MessagePayload( |
| 308 | id=str(uuid4()), |
| 309 | from_id=contact_id, |
| 310 | room_id=room_id, |
| 311 | text=msg |
| 312 | ) |
| 313 | self.add_fake_message(message_payload) |
| 314 | return message_payload.id |
| 315 | |
| 316 | def add_random_fake_contact(self) -> str: |
| 317 | """_summary_ |
nothing calls this directly
no test coverage detected