Added support for displaying and opening wall posts as attachments in conversations

This commit is contained in:
2019-05-29 09:17:02 -05:00
parent 7d52ed8802
commit 8ec7fbb49e
3 changed files with 14 additions and 2 deletions

View File

@@ -75,6 +75,14 @@ def add_attachment(attachment):
elif attachment["type"] == "poll":
tpe = _("Poll")
msg = attachment["poll"]["question"]
elif attachment["type"] == "wall":
tpe = _("Post")
user = attachment["wall"]["from"]["name"]
if len(attachment["wall"]["text"]) > 140:
text = attachment["wall"]["text"][:145]+"..."
else:
text = attachment["wall"]["text"]
msg = _("{user}: {post}").format(user=user, post=text)
else:
print(attachment)
return [tpe, msg]