Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0313.py @ 4002:5245b675f7ad
plugin XEP-0313: don't wait for MAM to be retrieved in connection workflow:
MAM retrieval can be long, and can be done after connection, message just need to be
sorted when being inserted (i.e. frontends must do insort).
To avoid blocking connection for too long and result in bad UX and timeout risk, one2one
MAM message are not retrieved in background.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 10 Mar 2023 17:22:45 +0100 |
parents | 813595f88612 |
children | 524856bd7b19 |
comparison
equal
deleted
inserted
replaced
4001:32d714a8ea51 | 4002:5245b675f7ad |
---|---|
157 log.info(_("We have received no message while offline")) | 157 log.info(_("We have received no message while offline")) |
158 else: | 158 else: |
159 log.info(_("We have received {num_mess} message(s) while offline.") | 159 log.info(_("We have received {num_mess} message(s) while offline.") |
160 .format(num_mess=count)) | 160 .format(num_mess=count)) |
161 | 161 |
162 async def profileConnected(self, client): | 162 def profileConnected(self, client): |
163 await self.resume(client) | 163 defer.ensureDeferred(self.resume(client)) |
164 | 164 |
165 def getHandler(self, client): | 165 def getHandler(self, client): |
166 mam_client = client._mam = SatMAMClient(self) | 166 mam_client = client._mam = SatMAMClient(self) |
167 return mam_client | 167 return mam_client |
168 | 168 |