Exemplo n.º 1
0
void ChatControler::_getContactInfo(service::ErrorInfo &info, service::User &user, Msg msg)
{
    qDebug() << Q_FUNC_INFO << "sfdsffffffffffffffffffffffffffffffff" <<  user.name.c_str();
    msg.name = QString::fromStdString(user.name);
    msg.thumb_avatar = QString::fromStdString(user.thumb_avatar);
    QDateTime dateTime = QDateTime::fromString(msg.time,"yyyy-MM-dd hh:mm:ss");
    qDebug() << "dddddddddddd:"<< msg.time;
    QString time = dealTime(dateTime.toMSecsSinceEpoch(),1);
    QString sessionId("");
    if(!getCurrentSessionId(sessionId)){
       emit sessionMessageNotice(msg.targetid,msg.msgid,msg.body,time,msg.name,msg.thumb_avatar,"0");
    }
    else{
       emit sessionMessageNotice(msg.targetid,msg.msgid,msg.body,time,msg.name,msg.thumb_avatar,"1");
    }
}
Exemplo n.º 2
0
void ChatControler::sendMessage(Msg &imMsg)
{
    qDebug() << Q_FUNC_INFO << "msg:" << imMsg.body << "TargetId:" << imMsg.targetid;

    QDateTime dateTime = QDateTime::fromString(imMsg.time,"yyyy-MM-dd hh:mm:ss");
    qDebug() << "dddddddddddd:"<< imMsg.time;
    QString time = dealTime(dateTime.toMSecsSinceEpoch(),1);

    emit sessionMessageNotice(imMsg.targetid,imMsg.msgid,imMsg.body,time,imMsg.name,imMsg.thumb_avatar,"0");
    if(imMsg.msgtype.toInt() == MSG_TYPE_TEXT)
    {
        service::MsgText msg = QmsgtextTomsgtext(imMsg);
        qDebug() << Q_FUNC_INFO << "cccc:" << msg.time;
        qDebug() << Q_FUNC_INFO << "sssssssssssss123:" << msg.msgtype;
//        msg.msgtype=2;

        service::IMClient::getClient()->getChat()->sendMessage(msg,
                     std::bind(&ChatControler::_sendMesage,this,
                               std::placeholders::_1,
                               std::placeholders::_2,
                               std::placeholders::_3));
    }
}
Exemplo n.º 3
0
void CDoodSessionListManager::initConnect()
{
    qDebug() << Q_FUNC_INFO;
     connect(m_pClient, SIGNAL(chatListChanged(const Chat_UIList &)), this, SLOT(onChatListChanged(const Chat_UIList &)));
     connect(m_pClient, SIGNAL(sessionMessageNotice(QString,QString,QString,QString,QString,QString)), this, SLOT(onSessionMessageNotice(QString,QString,QString,QString,QString,QString)));
}
Exemplo n.º 4
0
void LinkDoodService::initConnects()
{
    qDebug() << Q_FUNC_INFO ;

    QObject::connect(m_pChatObserver.get(),SIGNAL(avatarChangedBack(int64,QString)),this,
                     SLOT(onChatAvatarChanged(int64,QString)));
    QObject::connect(m_pChatObserver.get(),SIGNAL(offlineMsgNoticeBack(IMOfflineMsgList)),this,
                     SLOT(onChatOfflineMsgNotice(IMOfflineMsgList)));
    QObject::connect(m_pChatObserver.get(),SIGNAL(sendMessageBack(bool,int64,int64)),this,
                     SLOT(onChatSendMessageResult(bool,int64,int64)));
    QObject::connect(m_pChatObserver.get(),SIGNAL(getMessagesBack(bool,int64,MsgList)),this,
                     SLOT(onChatGetMessagesResult(bool,int64,MsgList)));
    QObject::connect(m_pChatObserver.get(),SIGNAL(removeChatBack(bool)),this,
                     SLOT(onChatRemoveChatResult(bool)));
    QObject::connect(m_pChatObserver.get(),SIGNAL(chatMessageNotice(Msg)),this,
                     SLOT(onChatMessageNotice(Msg)));
    QObject::connect(m_pChatObserver.get(),SIGNAL(sessionMessageNotice(QString,QString,QString,QString,QString,QString,QString)),this,
                     SLOT(onSessionMessageNotice(QString,QString,QString,QString, QString,QString,QString)));
    QObject::connect(m_pChatObserver.get(),SIGNAL(deleteMessagesBack(int)),this,
                     SLOT(onChatDeleteMessagesResult(int)));

    QObject::connect(m_pChatObserver.get(), SIGNAL(uploadAvatarBack(std::string,std::string,int)), this, SLOT(onChatUploadAvatar(QString,QString,int)));
    QObject::connect(m_pChatObserver.get(), SIGNAL(uploadFileBack(std::string,std::string,int)), this, SLOT(onChatUploadFile(QString,QString,int)));
    QObject::connect(m_pChatObserver.get(), SIGNAL(fileProgressBack(std::string,std::string,int)), this, SLOT(onChatFileProgress(QString,QString,int)));
    QObject::connect(m_pChatObserver.get(), SIGNAL(downloadFileBack(std::string,std::string,int)), this, SLOT(onChatDownloadFile(QString,QString,int)));
    QObject::connect(m_pChatObserver.get(), SIGNAL(uploadImageBack(std::string,std::string,int)), this, SLOT(onChatupLoadImage(QString,QString,int)));
    QObject::connect(m_pChatObserver.get(), SIGNAL(downloadImageBack(std::string,std::string,int)), this, SLOT(onChatDownloadImage(QString,QString,int)));
    QObject::connect(m_pChatObserver.get(), SIGNAL(getFileListBack(std::string,std::string,int)), this, SLOT(onChatGetFileList(QString,QString,int)));





    QObject::connect(m_pEnterpriseControler.get(),SIGNAL(getSonOrgsResult(int ,OrgList ,OrgUserList )),this,
                     SLOT(onGetSonOrgsResult(int,OrgList,OrgUserList )));
    QObject::connect(m_pEnterpriseControler.get(),SIGNAL(getOnlineStatesResult(QOnlineStateList)),this,
                     SLOT(onGetOnlineStatesResult(QOnlineStateList)));
    QObject::connect(m_pEnterpriseControler.get(),SIGNAL(getOrgUserInfoResult(int,OrgUser)),this,
                     SLOT(onGetorgUserInfoResult(int,OrgUser)));


    QObject::connect(m_pAuth.get(),SIGNAL(getLoginHistoryResult(LoginInfoList)),this,
                     SLOT(onGetLoginHistoryResult(LoginInfoList)));
    QObject::connect(m_pAuth.get(),SIGNAL(loginSucceeded()),this,
                     SLOT(onLoginSucceeded()));
    QObject::connect(m_pAuth.get(),SIGNAL(loginFailed(int)),this,
                     SLOT(onLoginFailed(int)));

    QObject::connect(m_pAuth.get(),SIGNAL(loginoutRelust(bool)),this,
                     SLOT(onLoginoutRelust(bool)));
    QObject::connect(m_pAuth.get(),SIGNAL(loginResultObserver(int,QString)),this,
                     SLOT(onLoginResultObserver(int,QString)));
    QObject::connect(m_pAuth.get(),SIGNAL(accountInfoChanged(Contact)),this,
                     SLOT(onAccountInfoChanged(Contact)));

    QObject::connect(m_pChatObserver.get(),SIGNAL(chatListChanged(Chat_UIList)),this,
                     SLOT(onChatListChanged(Chat_UIList)));
    QObject::connect(m_pContactObserver.get(),SIGNAL(contactListChanged(int,ContactList)),this,
                     SLOT(onContactListChanged(int,ContactList)));
    QObject::connect(m_pContactObserver.get(),SIGNAL(contactInfoChanged(int,Contact)),this,
                     SLOT(onContactInfoChanged(int,Contact)));
    QObject::connect(m_pContactObserver.get(),SIGNAL(contactOnlineChanged(QString,QString)),this,SLOT(onOnlineChanged(QString,QString)));
}
Exemplo n.º 5
0
void LinkDoodService::onSessionMessageNotice(QString targetId,QString msgId,QString lastMsg,
                                             QString time ,QString name,QString avater,QString unreadmsg)
{
    qDebug() << Q_FUNC_INFO;
    emit sessionMessageNotice(targetId, msgId, lastMsg,time,name,avater,unreadmsg);
}