Commit 45588d23 authored by Koen van der Veen's avatar Koen van der Veen
Browse files

fix profile pics

parent 0bdf8bcb
Pipeline #4333 passed with stage
in 1 minute and 12 seconds
Showing with 3 additions and 3 deletions
+3 -3
......@@ -336,13 +336,13 @@ class WhatsappPlugin(PluginBase):
# ipdb.set_trace()
# related_account = self.client.search({'type': 'Account', 'externalId': id})[0]
related_chat = self.stripped_jid2account[jid.split("@")[0]]
related_chat = self.stripped_jid2chat[jid.split("@")[0]]
if related_chat:
photo_bytes = requests.get(data["eurl"]).content
photo = Photo.from_bytes(photo_bytes)
self.client.create_photo(photo)
print(f"Updating profile picture for {related_chat.displayName}")
edge = Edge(related_chat, photo, "profilePicture")
print(f"Updating profile picture for {related_chat.name}")
edge = Edge(related_chat, photo, "photo")
self.client.create_edge(edge)
else:
print(f"Did not import profile picture for {jid}, could not find chat")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment