For outgoing messages, raise error if disconnected

This commit is contained in:
Andrew Ferrazzutti 2022-04-10 02:42:15 -04:00
parent 7b96687dae
commit 109e9bcc67

View File

@ -773,8 +773,8 @@ class Portal(DBPortal, BasePortal):
sender, is_relay = await self.get_relay_sender(orig_sender, f"message {event_id}") sender, is_relay = await self.get_relay_sender(orig_sender, f"message {event_id}")
if not sender: if not sender:
raise Exception("not logged in") raise Exception("not logged in")
elif not sender.has_state: elif not sender.is_connected:
raise Exception("not connected to KakaoTalk") raise Exception("not connected to KakaoTalk chats")
elif is_relay: elif is_relay:
await self.apply_relay_message_format(orig_sender, message) await self.apply_relay_message_format(orig_sender, message)
if message.msgtype == MessageType.TEXT or message.msgtype == MessageType.NOTICE: if message.msgtype == MessageType.TEXT or message.msgtype == MessageType.NOTICE: