コード例 #1
0
    def login(self, msg):
        """ Server code: 1 """

        log.add_msg_contents(msg)

        if msg.success:
            self.logged_in = True
            self.login_username = msg.username

            self.set_away_mode(config.sections["server"]["away"])
            self.watch_user(msg.username)

            if msg.ip_address is not None:
                self.user_ip_address = msg.ip_address

            self.transfers.server_login()
            self.search.server_login()
            self.userbrowse.server_login()
            self.userinfo.server_login()
            self.userlist.server_login()
            self.privatechats.server_login()
            self.chatrooms.server_login()

            if self.ui_callback:
                self.ui_callback.server_login()

            if msg.banner:
                log.add(msg.banner)

            self.interests.server_login()
            self.shares.send_num_shared_folders_files()

            self.queue.append(
                slskmessages.PrivateRoomToggle(
                    config.sections["server"]["private_chatrooms"]))
            self.pluginhandler.server_connect_notification()

        else:
            if msg.reason == "INVALIDPASS":
                self.ui_callback.invalid_password()
                return

            log.add_important_error(
                _("Unable to connect to the server. Reason: %s"), msg.reason)
コード例 #2
0
ファイル: roomlist.py プロジェクト: depsterr/nicotine-plus
    def on_toggle_accept_private_room(self, widget):

        value = self.AcceptPrivateRoom.get_active()
        self.frame.np.queue.append(slskmessages.PrivateRoomToggle(value))
コード例 #3
0
 def OnToggleAcceptPrivateRoom(self, widget):
     value = self.AcceptPrivateRoom.get_active()
     self.frame.np.queue.put(slskmessages.PrivateRoomToggle(value))
コード例 #4
0
 def request_private_room_toggle(self, enabled):
     self.queue.append(slskmessages.PrivateRoomToggle(enabled))