(self, hello)
| 133 | return username, roomName, version, motd, features |
| 134 | |
| 135 | def handleHello(self, hello): |
| 136 | username, roomName, version, motd, featureList = self._extractHelloArguments(hello) |
| 137 | if not username or not roomName or not version: |
| 138 | self.dropWithError(getMessage("hello-server-error").format(hello)) |
| 139 | else: |
| 140 | self._client.setUsername(username) |
| 141 | self._client.setRoom(roomName) |
| 142 | self.logged = True |
| 143 | if self.persistentRoomWarning(featureList): |
| 144 | span = "\n\n" if motd else "" |
| 145 | motd = getMessage("persistent-rooms-notice") + span + motd |
| 146 | if motd: |
| 147 | self._client.ui.showMessage(motd, noPlayer=True, noTimestamp=True, isMotd=True) |
| 148 | self._client.ui.showMessage(getMessage("connected-successful-notification")) |
| 149 | self._client.connected() |
| 150 | self._client.sendFile() |
| 151 | self._client.setServerVersion(version, featureList) |
| 152 | |
| 153 | def persistentRoomWarning(self, serverFeatures): |
| 154 | return serverFeatures["persistentRooms"] if "persistentRooms" in serverFeatures else False |
no test coverage detected