aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-10-04 19:19:58 +0200
committerAlex Auvolat <alex@adnab.me>2020-10-04 19:20:32 +0200
commitd3ab4fa8cafa0aeedb626d2067659d75c88a1b4f (patch)
tree59396e07a073b2a59716e6551a9565625bd41dd0 /external
parenta688840fbfcabfa91167b06ae9561be159b280db (diff)
downloadeasybridge-d3ab4fa8cafa0aeedb626d2067659d75c88a1b4f.tar.gz
easybridge-d3ab4fa8cafa0aeedb626d2067659d75c88a1b4f.zip
Update go packages; remove db cache
Diffstat (limited to 'external')
-rwxr-xr-xexternal/messenger.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/external/messenger.py b/external/messenger.py
index 3df1a5c..76ca90d 100755
--- a/external/messenger.py
+++ b/external/messenger.py
@@ -251,7 +251,7 @@ class MessengerBridge:
self.my_user_id = self.getUserIdFromUid(self.client.uid)
- threads = self.client.fetchThreadList()
+ threads = self.client.fetchThreadList(limit=10)
# ensure we have a correct mapping for bridged user IDs to fb uids
# (this should be fast)
for thread in threads:
@@ -478,7 +478,11 @@ class MessengerBridge:
for at in message_object.attachments:
if isinstance(at, ImageAttachment):
- full_url = self.client.fetchImageUrl(at.uid)
+ try:
+ full_url = self.client.fetchImageUrl(at.uid)
+ except:
+ time.sleep(1)
+ full_url = self.client.fetchImageUrl(at.uid)
event["attachments"].append({
"filename": full_url.split("?")[0].split("/")[-1],
"url": full_url,
@@ -499,6 +503,8 @@ class MessengerBridge:
"filename": at.filename,
"url": url,
})
+ elif isinstance(at, ShareAttachment):
+ event["text"] += "\n{}\n{}".format(at.description, at.url)
else:
event["text"] += "\nUnhandled attachment: {}".format(at)