コード例 #1
0
ファイル: contact_list_win.py プロジェクト: qq40660/iBlah_py
    def _consume_invitation(self, res_obj, sock):
        assert (sock is not None)

        """ TODO: ignore invitation will prevent from hide detecting. """
        i_send_ack(res_obj, sock)

        attr = res_obj.headers.get_field_value
        from_uri = attr("F")

        conv = Conversation(from_uri)
        convs = self.user.get_conversations()
        convs[from_uri] = conv
        get_sock_for_recv_msg_thread = IThread(get_sock_for_recv_msg, user = self.user, res_obj = res_obj,
                                      debug = True)
        conv.get_sock_for_recv_msg_thread = get_sock_for_recv_msg_thread
        self.connect(conv.get_sock_for_recv_msg_thread, QtCore.SIGNAL("thread_finished()"),
                     self.recv_msg_t_finished)
        conv.get_sock_for_recv_msg_thread.start()
コード例 #2
0
    def _consume_invitation(self, res_obj, sock):
        assert (sock is not None)
        """ TODO: ignore invitation will prevent from hide detecting. """
        i_send_ack(res_obj, sock)

        attr = res_obj.headers.get_field_value
        from_uri = attr("F")

        conv = Conversation(from_uri)
        convs = self.user.get_conversations()
        convs[from_uri] = conv
        get_sock_for_recv_msg_thread = IThread(get_sock_for_recv_msg,
                                               user=self.user,
                                               res_obj=res_obj,
                                               debug=True)
        conv.get_sock_for_recv_msg_thread = get_sock_for_recv_msg_thread
        self.connect(conv.get_sock_for_recv_msg_thread,
                     QtCore.SIGNAL("thread_finished()"),
                     self.recv_msg_t_finished)
        conv.get_sock_for_recv_msg_thread.start()
コード例 #3
0
ファイル: chat_win.py プロジェクト: williamyangcn/iBlah_py
    def send_msg(self, msg):
        my_name = self.user.get_display_name()

        cur_idx = self.convTab.currentIndex()
        to_uri = str(self.convTab.tabBar().tabData(cur_idx).toString())
        assert to_uri not in (None, "")

        convs = self.user.get_conversations()
        if to_uri not in convs:
            conv = Conversation(to_uri)
            convs[to_uri] = conv
        else:
            conv = convs[to_uri]

        send_msg_thread = IThread(i_send_msg, user = self.user, to_uri = to_uri, msg = msg)
        conv.send_msg_thread = send_msg_thread
        self.connect(send_msg_thread, QtCore.SIGNAL("thread_finished()"), self.send_msg_t_finished)
        send_msg_thread.start()

        chat_history_model = self.blah.contact_list_win.chat_history[to_uri]
        self.append_to_chat_history(chat_history_model, my_name, msg, MYSELF_LOG_TPL)