Make clientManager easier to use

- Backend.clientManager renamed to Backend.clients
- clientManager is now a Mapping subclass

Before/After from Python:
backend.clientManager.clients[thing] → backend.clients[thing]

From QML:
Backend.clientManager.clients[thing] → Backend.clients.get(thing)
This commit is contained in:
miruka
2019-05-02 14:54:37 -04:00
parent 52d538e995
commit 51386821bc
10 changed files with 53 additions and 44 deletions

View File

@@ -30,16 +30,12 @@ Banner {
buttonCallbacks: {
"accept": function(button) {
button.loading = true
Backend.clientManager.clients[chatPage.userId].joinRoom(
chatPage.roomId
)
Backend.clients.get(chatPage.userId).joinRoom(chatPage.roomId)
},
"decline": function(button) {
button.loading = true
Backend.clientManager.clients[chatPage.userId].leaveRoom(
chatPage.roomId
)
Backend.clients.get(chatPage.userId).leaveRoom(chatPage.roomId)
}
}
}

View File

@@ -22,9 +22,7 @@ Banner {
"forget": function(button) {
button.loading = true
chatPage.canLoadPastEvents = false
Backend.clientManager.clients[chatPage.userId].forgetRoom(
chatPage.roomId
)
Backend.clients.get(chatPage.userId).forgetRoom(chatPage.roomId)
pageStack.clear()
},
}