forked from fair/matrix-puppeteer-line
Minor tweaks
This commit is contained in:
parent
a4a3d2862c
commit
cd75cb0d35
@ -136,8 +136,8 @@ class Portal(DBPortal, BasePortal):
|
|||||||
|
|
||||||
async def handle_matrix_message(self, sender: 'u.User', message: MessageEventContent,
|
async def handle_matrix_message(self, sender: 'u.User', message: MessageEventContent,
|
||||||
event_id: EventID) -> None:
|
event_id: EventID) -> None:
|
||||||
if not sender.client:
|
if not await sender.is_logged_in():
|
||||||
self.log.debug(f"Ignoring message {event_id} as user is not connected")
|
self.log.debug(f"Ignoring message {event_id} as sender {sender.mxid} is not connected")
|
||||||
return
|
return
|
||||||
elif ((message.get(self.bridge.real_user_content_key,
|
elif ((message.get(self.bridge.real_user_content_key,
|
||||||
False) and await p.Puppet.get_by_custom_mxid(sender.mxid))):
|
False) and await p.Puppet.get_by_custom_mxid(sender.mxid))):
|
||||||
|
@ -178,9 +178,11 @@ class User(DBUser, BaseUser):
|
|||||||
chat_id = portal.chat_id
|
chat_id = portal.chat_id
|
||||||
self.log.info(f"Viewing (and syncing) chat {chat_id}")
|
self.log.info(f"Viewing (and syncing) chat {chat_id}")
|
||||||
await self.client.pause()
|
await self.client.pause()
|
||||||
chat = await self.client.get_chat(chat_id, True)
|
try:
|
||||||
await portal.update_matrix_room(self, chat)
|
chat = await self.client.get_chat(chat_id, True)
|
||||||
await self.client.resume()
|
await portal.update_matrix_room(self, chat)
|
||||||
|
finally:
|
||||||
|
await self.client.resume()
|
||||||
|
|
||||||
async def sync_own_profile(self) -> None:
|
async def sync_own_profile(self) -> None:
|
||||||
self.log.info("Syncing own LINE profile info")
|
self.log.info("Syncing own LINE profile info")
|
||||||
|
@ -1752,7 +1752,7 @@ new MutationObserver(() => {
|
|||||||
if (!layer.classList.contains("MdNonDisp")) {
|
if (!layer.classList.contains("MdNonDisp")) {
|
||||||
const button = layer.querySelector("dialog button")
|
const button = layer.querySelector("dialog button")
|
||||||
if (button) {
|
if (button) {
|
||||||
console.log("Something expired, clicking OK button to continue")
|
console.log("Popup appeared, clicking OK button to continue")
|
||||||
button.click()
|
button.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user