Mercurial > libervia-backend
comparison sat_frontends/quick_frontend/quick_chat.py @ 4023:78b5f356900c
component AP gateway: handle attachments
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 23 Mar 2023 15:42:21 +0100 |
parents | be6d91572633 |
children | 524856bd7b19 |
comparison
equal
deleted
inserted
replaced
4022:cdb7de398c85 | 4023:78b5f356900c |
---|---|
221 for lang, mess in self.message.items(): | 221 for lang, mess in self.message.items(): |
222 self.message[lang] = "* " + nick + mess[3:] | 222 self.message[lang] = "* " + nick + mess[3:] |
223 | 223 |
224 @property | 224 @property |
225 def attachments(self): | 225 def attachments(self): |
226 return self.extra.get(C.MESS_KEY_ATTACHMENTS) | 226 return self.extra.get(C.KEY_ATTACHMENTS) |
227 | 227 |
228 | 228 |
229 class MessageWidget: | 229 class MessageWidget: |
230 """Base classe for widgets""" | 230 """Base classe for widgets""" |
231 # This class does nothing and is only used to have a common ancestor | 231 # This class does nothing and is only used to have a common ancestor |
731 extra, | 731 extra, |
732 profile, | 732 profile, |
733 ) | 733 ) |
734 return | 734 return |
735 | 735 |
736 if ((not msg and not subject and not extra[C.MESS_KEY_ATTACHMENTS] | 736 if ((not msg and not subject and not extra[C.KEY_ATTACHMENTS] |
737 and type_ != C.MESS_TYPE_INFO)): | 737 and type_ != C.MESS_TYPE_INFO)): |
738 log.warning("Received an empty message for uid {}".format(uid)) | 738 log.warning("Received an empty message for uid {}".format(uid)) |
739 return | 739 return |
740 | 740 |
741 if self.type == C.CHAT_GROUP: | 741 if self.type == C.CHAT_GROUP: |