Prevent queuing lots of setTypingState

@futurize() is now called with parentheses and can take a max_instances
int argument. This is used for setTypingState to not have more than one
queued calls per room and True/False state and avoids bombing the server
with old ephemeral events after a network loss and reconnection.
This commit is contained in:
miruka
2019-04-19 18:21:19 -04:00
parent 188dc6be98
commit aa55ffbc6a
3 changed files with 40 additions and 24 deletions

View File

@@ -48,7 +48,7 @@ class Backend(QObject):
@pyqtSlot(str, result="QVariant")
@pyqtSlot(str, bool, result="QVariant")
@futurize
@futurize()
def getUserDisplayName(self, user_id: str, can_block: bool = True) -> str:
if user_id in self._queried_displaynames:
return self._queried_displaynames[user_id]