def _setPresenceError(self, tag): error = errors.createServerActionPresenceError(self._getActionID(), tag) if error is not None: if error.getErrorType() == ERROR_TYPE.AUTH and error.getCondition() == 'not-authorized' and self._step != ENTRY_STEP.PASSWORD_REQUIRED: self._step = ENTRY_STEP.PASSWORD_REQUIRED g_messengerEvents.channels.onConnectingToSecureChannel(self._room) else: g_messengerEvents.onErrorReceived(error) self._remove() else: self._remove() return