Changeset 3471 for branches/protocol_plugin_1_3_0
- Timestamp:
- 05/01/03 10:02:06 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/protocol_plugin_1_3_0/qt-gui/src/usereventdlg.cpp
r3467 r3471 75 75 76 76 // ----------------------------------------------------------------------------- 77 #ifdef QT_PROTOCOL_PLUGIN 78 UserEventCommon::UserEventCommon(CICQDaemon *s, CSignalManager *theSigMan, 79 CMainWindow *m, const char *_szId, 80 unsigned long _nPPID, QWidget *parent, 81 const char *name) 82 : QWidget(parent, name, WDestructiveClose) 83 { 84 server = s; 85 mainwin = m; 86 sigman = theSigMan; 87 m_szId = _szId ? strdup(_szId) : 0; 88 m_nPPID = _nPPID; 89 m_bOwner = (gUserManager.FindOwner(m_szId, m_nPPID) != NULL); 90 m_bDeleteUser = false; 91 92 top_hlay = new QHBoxLayout(this, 6); 93 top_lay = new QVBoxLayout(top_hlay); 94 top_hlay->setStretchFactor(top_lay, 1); 95 96 // initalize codec 97 codec = QTextCodec::codecForLocale(); 98 99 QBoxLayout *layt = new QHBoxLayout(top_lay, 8); 100 layt->addWidget(new QLabel(tr("Status:"), this)); 101 nfoStatus = new CInfoField(this, true); 102 nfoStatus->setMinimumWidth(nfoStatus->sizeHint().width()+30); 103 layt->addWidget(nfoStatus); 104 layt->addWidget(new QLabel(tr("Time:"), this)); 105 nfoTimezone = new CInfoField(this, true); 106 nfoTimezone->setMinimumWidth(nfoTimezone->sizeHint().width()/2+10); 107 layt->addWidget(nfoTimezone); 108 109 popupEncoding = new QPopupMenu(this); 110 btnSecure = new QPushButton(this); 111 QToolTip::add(btnSecure, tr("Open / Close secure channel")); 112 layt->addWidget(btnSecure); 113 connect(btnSecure, SIGNAL(clicked()), this, SLOT(slot_security())); 114 btnHistory = new QPushButton(this); 115 btnHistory->setPixmap(mainwin->pmHistory); 116 QToolTip::add(btnHistory, tr("Show User History")); 117 connect(btnHistory, SIGNAL(clicked()), this, SLOT(showHistory())); 118 layt->addWidget(btnHistory); 119 btnInfo = new QPushButton(this); 120 btnInfo->setPixmap(mainwin->pmInfo); 121 QToolTip::add(btnInfo, tr("Show User Info")); 122 connect(btnInfo, SIGNAL(clicked()), this, SLOT(showUserInfo())); 123 layt->addWidget(btnInfo); 124 btnEncoding = new QPushButton(this); 125 btnEncoding->setPixmap(mainwin->pmEncoding); 126 QToolTip::add(btnEncoding, tr("Change user text encoding")); 127 QWhatsThis::add(btnEncoding, tr("This button selects the text encoding used when communicating with this user. You might need to change the encoding to communicate in a different language.")); 128 btnEncoding->setPopup(popupEncoding); 129 130 layt->addWidget(btnEncoding); 131 132 tmrTime = NULL; 133 134 ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_W); 135 if (u != NULL) 136 { 137 nfoStatus->setData(u->StatusStr()); 138 if (u->NewMessages() == 0) 139 setIcon(CMainWindow::iconForStatus(u->StatusFull())); 140 else 141 setIcon(CMainWindow::iconForEvent(ICQ_CMDxSUB_MSG)); 142 SetGeneralInfo(u); 143 144 // restore prefered encoding 145 codec = UserCodec::codecForICQUser(u); 146 147 gUserManager.DropUser(u); 148 } 149 150 QString codec_name = QString::fromLatin1( codec->name() ).lower(); 151 popupEncoding->setCheckable(true); 152 153 // populate the popup menu 154 UserCodec::encoding_t *it = &UserCodec::m_encodings[0]; 155 while(it->encoding != NULL) { 156 157 if (QString::fromLatin1(it->encoding).lower() == codec_name) { 158 if (mainwin->m_bShowAllEncodings || it->isMinimal) { 159 popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, SLOT(slot_setEncoding(int)), 0, it->mib); 160 } else { 161 // if the current encoding does not appear in the minimal list 162 popupEncoding->insertSeparator(0); 163 popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, SLOT(slot_setEncoding(int)), 0, it->mib, 0); 164 } 165 popupEncoding->setItemChecked(it->mib, true); 166 } else { 167 if (mainwin->m_bShowAllEncodings || it->isMinimal) { 168 popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, SLOT(slot_setEncoding(int)), 0, it->mib); 169 } 170 } 171 172 ++it; 173 } 174 175 connect (sigman, SIGNAL(signal_updatedUser(CICQSignal *)), 176 this, SLOT(slot_userupdated(CICQSignal *))); 177 178 mainWidget = new QWidget(this); 179 top_lay->addWidget(mainWidget); 180 } 181 #endif 182 77 183 #if QT_VERSION >= 300 78 184 UserEventTabDlg::UserEventTabDlg(QWidget *parent, const char *name) … … 235 341 236 342 // ----------------------------------------------------------------------------- 237 #ifdef QT_PROTOCOL_PLUGIN 343 238 344 UserEventCommon::UserEventCommon(CICQDaemon *s, CSignalManager *theSigMan, 239 CMainWindow *m, const char *_szId, 240 unsigned long _nPPID, QWidget *parent, 241 const char *name) 345 CMainWindow *m, unsigned long _nUin, 346 QWidget* parent, const char* name) 242 347 : QWidget(parent, name, WDestructiveClose) 243 348 { 349 #ifdef QT_PROTOCOL_PLUGIN 350 char szUin[24]; 351 sprintf(szUin, "%lu", _nUin); 352 m_szId = strdup(szUin); 353 m_nPPID = LICQ_PPID; 354 #endif 244 355 server = s; 245 356 mainwin = m; 246 357 sigman = theSigMan; 247 m_szId = _szId ? strdup(_szId) : 0; 248 m_nPPID = _nPPID; 249 m_bOwner = (gUserManager.FindOwner(m_szId, m_nPPID) != NULL); 358 m_nUin = _nUin; 359 m_bOwner = (m_nUin == gUserManager.OwnerUin()); 250 360 m_bDeleteUser = false; 251 361 … … 292 402 tmrTime = NULL; 293 403 294 ICQUser *u = gUserManager.FetchUser(m_ szId, m_nPPID, LOCK_W);404 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W); 295 405 if (u != NULL) 296 406 { … … 339 449 top_lay->addWidget(mainWidget); 340 450 } 341 #endif342 343 UserEventCommon::UserEventCommon(CICQDaemon *s, CSignalManager *theSigMan,344 CMainWindow *m, unsigned long _nUin,345 QWidget* parent, const char* name)346 : QWidget(parent, name, WDestructiveClose)347 {348 #ifdef QT_PROTOCOL_PLUGIN349 char szUin[24];350 sprintf(szUin, "%lu", _nUin);351 m_szId = strdup(szUin);352 m_nPPID = LICQ_PPID;353 #endif354 server = s;355 mainwin = m;356 sigman = theSigMan;357 m_nUin = _nUin;358 m_bOwner = (m_nUin == gUserManager.OwnerUin());359 m_bDeleteUser = false;360 361 top_hlay = new QHBoxLayout(this, 6);362 top_lay = new QVBoxLayout(top_hlay);363 top_hlay->setStretchFactor(top_lay, 1);364 365 // initalize codec366 codec = QTextCodec::codecForLocale();367 368 QBoxLayout *layt = new QHBoxLayout(top_lay, 8);369 layt->addWidget(new QLabel(tr("Status:"), this));370 nfoStatus = new CInfoField(this, true);371 nfoStatus->setMinimumWidth(nfoStatus->sizeHint().width()+30);372 layt->addWidget(nfoStatus);373 layt->addWidget(new QLabel(tr("Time:"), this));374 nfoTimezone = new CInfoField(this, true);375 nfoTimezone->setMinimumWidth(nfoTimezone->sizeHint().width()/2+10);376 layt->addWidget(nfoTimezone);377 378 popupEncoding = new QPopupMenu(this);379 btnSecure = new QPushButton(this);380 QToolTip::add(btnSecure, tr("Open / Close secure channel"));381 layt->addWidget(btnSecure);382 connect(btnSecure, SIGNAL(clicked()), this, SLOT(slot_security()));383 btnHistory = new QPushButton(this);384 btnHistory->setPixmap(mainwin->pmHistory);385 QToolTip::add(btnHistory, tr("Show User History"));386 connect(btnHistory, SIGNAL(clicked()), this, SLOT(showHistory()));387 layt->addWidget(btnHistory);388 btnInfo = new QPushButton(this);389 btnInfo->setPixmap(mainwin->pmInfo);390 QToolTip::add(btnInfo, tr("Show User Info"));391 connect(btnInfo, SIGNAL(clicked()), this, SLOT(showUserInfo()));392 layt->addWidget(btnInfo);393 btnEncoding = new QPushButton(this);394 btnEncoding->setPixmap(mainwin->pmEncoding);395 QToolTip::add(btnEncoding, tr("Change user text encoding"));396 QWhatsThis::add(btnEncoding, tr("This button selects the text encoding used when communicating with this user. You might need to change the encoding to communicate in a different language."));397 btnEncoding->setPopup(popupEncoding);398 399 layt->addWidget(btnEncoding);400 401 tmrTime = NULL;402 403 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W);404 if (u != NULL)405 {406 nfoStatus->setData(u->StatusStr());407 if (u->NewMessages() == 0)408 setIcon(CMainWindow::iconForStatus(u->StatusFull()));409 else410 setIcon(CMainWindow::iconForEvent(ICQ_CMDxSUB_MSG));411 SetGeneralInfo(u);412 413 // restore prefered encoding414 codec = UserCodec::codecForICQUser(u);415 416 gUserManager.DropUser(u);417 }418 419 QString codec_name = QString::fromLatin1( codec->name() ).lower();420 popupEncoding->setCheckable(true);421 422 // populate the popup menu423 UserCodec::encoding_t *it = &UserCodec::m_encodings[0];424 while(it->encoding != NULL) {425 426 if (QString::fromLatin1(it->encoding).lower() == codec_name) {427 if (mainwin->m_bShowAllEncodings || it->isMinimal) {428 popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, SLOT(slot_setEncoding(int)), 0, it->mib);429 } else {430 // if the current encoding does not appear in the minimal list431 popupEncoding->insertSeparator(0);432 popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, SLOT(slot_setEncoding(int)), 0, it->mib, 0);433 }434 popupEncoding->setItemChecked(it->mib, true);435 } else {436 if (mainwin->m_bShowAllEncodings || it->isMinimal) {437 popupEncoding->insertItem(UserCodec::nameForEncoding(it->encoding), this, SLOT(slot_setEncoding(int)), 0, it->mib);438 }439 }440 441 ++it;442 }443 444 connect (sigman, SIGNAL(signal_updatedUser(CICQSignal *)),445 this, SLOT(slot_userupdated(CICQSignal *)));446 447 mainWidget = new QWidget(this);448 top_lay->addWidget(mainWidget);449 }450 451 451 452 void UserEventCommon::slot_setEncoding(int encodingMib) { … … 471 472 472 473 /* save prefered character set */ 474 #ifdef QT_PROTOCOL_PLUGIN 475 ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_W); 476 #else 473 477 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W); 478 #endif 474 479 if (u != NULL) { 475 480 u->SetEnableSave(false); … … 544 549 if (m_bDeleteUser && !m_bOwner) 545 550 mainwin->RemoveUserFromList(strdup(m_szId), m_nPPID, this); 546 551 547 552 free(m_szId); 548 553 #else … … 875 880 if(!chkAutoClose->isChecked()) return; 876 881 882 #ifdef QT_PROTOCOL_PLUGIN 883 ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R); 884 #else 877 885 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R); 886 #endif 878 887 bool doclose = (u->NewMessages() == 0); 879 888 gUserManager.DropUser(u); … … 983 992 btnRead4->setText(tr("Start Chat")); 984 993 break; 985 994 986 995 case ICQ_CMDxSUB_SMS: 987 996 btnEncoding->setEnabled(false); … … 1002 1011 btnRead1->setText(tr("A&uthorize")); 1003 1012 btnRead2->setText(tr("&Refuse")); 1013 #ifdef QT_PROTOCOL_PLUGIN 1014 CEventAuthRequest *pAuthReq = (CEventAuthRequest *)m;; 1015 ICQUser *u = gUserManager.FetchUser(pAuthReq->IdString(), pAuthReq->PPID(), LOCK_R); 1016 #else 1004 1017 ICQUser *u = gUserManager.FetchUser( ((CEventAuthRequest *)m)->Uin(), LOCK_R); 1018 #endif 1005 1019 if (u == NULL) 1006 1020 btnRead3->setText(tr("A&dd User")); … … 1011 1025 case ICQ_CMDxSUB_AUTHxGRANTED: 1012 1026 { 1027 #ifdef QT_PROTOCOL_PLUGIN 1028 CEventAuthGranted *pAuth = (CEventAuthGranted *)m; 1029 ICQUser *u = gUserManager.FetchUser(pAuth->IdString(), pAuth->PPID(), LOCK_R); 1030 #else 1013 1031 ICQUser *u = gUserManager.FetchUser( ((CEventAuthGranted *)m)->Uin(), LOCK_R); 1032 #endif 1014 1033 if (u == NULL) 1015 1034 btnRead1->setText(tr("A&dd User")); … … 1020 1039 case ICQ_CMDxSUB_ADDEDxTOxLIST: 1021 1040 { 1041 #ifdef QT_PROTOCOL_PLUGIN 1042 CEventAdded *pAdd = (CEventAdded *)m; 1043 ICQUser *u = gUserManager.FetchUser(pAdd->IdString(), pAdd->PPID(), LOCK_R); 1044 #else 1022 1045 ICQUser *u = gUserManager.FetchUser( ((CEventAdded *)m)->Uin(), LOCK_R); 1046 #endif 1023 1047 if (u == NULL) 1024 1048 btnRead1->setText(tr("A&dd User")); … … 1048 1072 if (e->m_nEventId != -1 && e->msg->Direction() == D_RECEIVER) 1049 1073 { 1074 #ifdef QT_PROTOCOL_PLUGIN 1075 ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_W); 1076 #else 1050 1077 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_W); 1078 #endif 1051 1079 u->EventClearId(e->m_nEventId); 1052 1080 gUserManager.DropUser(u); … … 1077 1105 void UserViewEvent::sendMsg(QString txt) 1078 1106 { 1107 #ifdef QT_PROTOCOL_PLUGIN 1108 UserSendMsgEvent *e = new UserSendMsgEvent(server, sigman, mainwin, m_szId, m_nPPID); 1109 #else 1079 1110 UserSendMsgEvent *e = new UserSendMsgEvent(server, sigman, mainwin, m_nUin); 1111 #endif 1080 1112 e->setText(txt); 1081 1113 … … 1121 1153 1122 1154 case ICQ_CMDxSUB_AUTHxREQUEST: 1155 { 1156 #ifdef QT_PROTOCOL_PLUGIN 1157 CEventAuthRequest *p = (CEventAuthRequest *)m_xCurrentReadEvent; 1158 (void) new AuthUserDlg(server, p->IdString(), p->PPID(), true); 1159 #else 1123 1160 (void) new AuthUserDlg(server, ((CEventAuthRequest *)m_xCurrentReadEvent)->Uin(), true); 1161 #endif 1124 1162 break; 1163 } 1125 1164 1126 1165 case ICQ_CMDxSUB_AUTHxGRANTED: 1127 #ifdef QT_PROTOCOL_PLUGIN 1128 { 1166 { 1167 #ifdef QT_PROTOCOL_PLUGIN 1129 1168 CEventAuthGranted *p = (CEventAuthGranted *)m_xCurrentReadEvent; 1130 1169 server->AddUserToList(p->IdString(), p->PPID()); 1131 }1132 1170 #else 1133 1171 server->AddUserToList( ((CEventAuthGranted *)m_xCurrentReadEvent)->Uin()); 1134 1172 #endif 1135 1173 break; 1174 } 1136 1175 1137 1176 case ICQ_CMDxSUB_ADDEDxTOxLIST: 1138 #ifdef QT_PROTOCOL_PLUGIN 1139 { 1177 { 1178 #ifdef QT_PROTOCOL_PLUGIN 1140 1179 CEventAdded *p = (CEventAdded *)m_xCurrentReadEvent; 1141 1180 server->AddUserToList(p->IdString(), p->PPID()); 1142 }1143 1181 #else 1144 1182 server->AddUserToList( ((CEventAdded *)m_xCurrentReadEvent)->Uin()); 1145 1183 #endif 1146 1184 break; 1185 } 1186 1147 1187 case ICQ_CMDxSUB_CONTACTxLIST: 1148 1188 { … … 1151 1191 ContactList::const_iterator it; 1152 1192 for(it = cl.begin(); it != cl.end(); ++it) { 1193 #ifdef QT_PROTOCOL_PLUGIN 1194 ICQUser *u = gUserManager.FetchUser((*it)->IdString(), (*it)->PPID(), LOCK_R); 1195 #else 1153 1196 ICQUser* u = gUserManager.FetchUser((*it)->Uin(), LOCK_R); 1197 #endif 1154 1198 if(u == NULL) 1155 1199 server->AddUserToList((*it)->Uin()); … … 1186 1230 { 1187 1231 if (chatDlg->StartAsClient(c->Port())) 1232 #ifdef QT_PROTOCOL_PLUGIN 1233 { 1234 //TODO in CICQDaemon 1235 server->icqChatRequestAccept(strtoul(m_szId, (char **)NULL, 10), 0, 1236 c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1237 } 1238 #else 1188 1239 server->icqChatRequestAccept(m_nUin, 0, c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1240 #endif 1189 1241 } 1190 1242 else // single party (other side connects to us) 1191 1243 { 1192 1244 if (chatDlg->StartAsServer()) 1245 #ifdef QT_PROTOCOL_PLUGIN 1246 { 1247 //TODO in CICQDaemon 1248 server->icqChatRequestAccept(strtoul(m_szId, (char **)NULL, 10), 1249 chatDlg->LocalPort(), c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1250 } 1251 #else 1193 1252 server->icqChatRequestAccept(m_nUin, chatDlg->LocalPort(), c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1253 #endif 1194 1254 } 1195 1255 break; … … 1260 1320 btnRead2->setEnabled(false); 1261 1321 btnRead3->setEnabled(false); 1322 #ifdef QT_PROTOCOL_PLUGIN 1323 //TODO in CICQDaemon 1324 server->icqChatRequestRefuse(strtoul(m_szId, (char **)NULL, 10), 1325 codec->fromUnicode(r->RefuseMessage()), 1326 m_xCurrentReadEvent->Sequence(), c->MessageID(), c->IsDirect()); 1327 #else 1262 1328 server->icqChatRequestRefuse(m_nUin, codec->fromUnicode(r->RefuseMessage()), 1263 1329 m_xCurrentReadEvent->Sequence(), c->MessageID(), c->IsDirect()); 1330 #endif 1264 1331 } 1265 1332 delete r; … … 1269 1336 case ICQ_CMDxSUB_FILE: // refuse a file transfer 1270 1337 { 1338 #ifdef QT_PROTOCOL_PLUGIN 1339 CRefuseDlg *r = new CRefuseDlg(m_szId, m_nPPID, tr("File Transfer"), this); 1340 #else 1271 1341 CRefuseDlg *r = new CRefuseDlg(m_nUin, tr("File Transfer"), this); 1342 #endif 1272 1343 if (r->exec()) 1273 1344 { … … 1276 1347 btnRead2->setEnabled(false); 1277 1348 btnRead3->setEnabled(false); 1349 #ifdef QT_PROTOCOL_PLUGIN 1350 //TODO 1351 server->icqFileTransferRefuse(strtoul(m_szId, (char **)NULL, 10), 1352 codec->fromUnicode(r->RefuseMessage()), 1353 m_xCurrentReadEvent->Sequence(), f->MessageID(), f->IsDirect()); 1354 #else 1278 1355 server->icqFileTransferRefuse(m_nUin, codec->fromUnicode(r->RefuseMessage()), 1279 1356 m_xCurrentReadEvent->Sequence(), f->MessageID(), f->IsDirect()); 1357 #endif 1280 1358 } 1281 1359 delete r; … … 1284 1362 1285 1363 case ICQ_CMDxSUB_AUTHxREQUEST: 1364 #ifdef QT_PROTOCOL_PLUGIN 1365 { 1366 CEventAuthRequest *p = (CEventAuthRequest *)m_xCurrentReadEvent; 1367 server->AddUserToList(p->IdString(), p->PPID()); 1368 break; 1369 } 1370 #else 1286 1371 server->AddUserToList( ((CEventAuthRequest *)m_xCurrentReadEvent)->Uin()); 1287 1372 break; 1288 1373 #endif 1289 1374 } 1290 1375 } … … 1298 1383 { 1299 1384 case ICQ_CMDxSUB_MSG: 1385 #ifdef QT_PROTOCOL_PLUGIN 1386 mainwin->callFunction(mnuUserSendChat, m_szId, m_nPPID); 1387 #else 1300 1388 mainwin->callFunction(mnuUserSendChat, Uin()); 1389 #endif 1301 1390 break; 1302 1391 case ICQ_CMDxSUB_CHAT: // join to current chat … … 1305 1394 if (c->Port() != 0) // Joining a multiparty chat (we connect to them) 1306 1395 { 1396 #ifdef QT_PROTOCOL_PLUGIN 1397 ChatDlg *chatDlg = new ChatDlg(m_szId, m_nPPID, server, mainwin); 1398 //TODO 1399 if (chatDlg->StartAsClient(c->Port())) 1400 server->icqChatRequestAccept(strtoul(m_szId, (char **)NULL, 10), 0, c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1401 #else 1307 1402 ChatDlg *chatDlg = new ChatDlg(m_nUin, server, mainwin); 1308 1403 if (chatDlg->StartAsClient(c->Port())) 1309 1404 server->icqChatRequestAccept(m_nUin, 0, c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1405 #endif 1310 1406 } 1311 1407 else // single party (other side connects to us) … … 1314 1410 CJoinChatDlg *j = new CJoinChatDlg(this); 1315 1411 if (j->exec() && (chatDlg = j->JoinedChat()) != NULL) 1412 #ifdef QT_PROTOCOL_PLUGIN 1413 //TODO 1414 server->icqChatRequestAccept(strtoul(m_szId, (char **)NULL, 10), chatDlg->LocalPort(), c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1415 #else 1316 1416 server->icqChatRequestAccept(m_nUin, chatDlg->LocalPort(), c->Clients(), c->Sequence(), c->MessageID(), c->IsDirect()); 1417 #endif 1317 1418 delete j; 1318 1419 } … … 1384 1485 void UserViewEvent::slot_sentevent(ICQEvent *e) 1385 1486 { 1487 #ifdef QT_PROTOCOL_PLUGIN 1488 if (e->PPID() != m_nPPID || (strcmp(e->Id(), m_szId) != 0)) return; 1489 #else 1386 1490 if (e->Uin() != m_nUin) return; 1491 #endif 1387 1492 if (!mainwin->m_bMsgChatView) 1388 1493 (void) new MsgViewItem(e->GrabUserEvent(), codec, msgView); … … 1607 1712 void UserSendCommon::windowActivationChange(bool oldActive) 1608 1713 { 1714 #ifdef QT_PROTOCOL_PLUGIN 1715 ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R); 1716 #else 1717 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R); 1718 #endif 1719 1609 1720 if (isActiveWindow() && mainwin->m_bMsgChatView && 1610 1721 (!mainwin->userEventTabDlg || … … 1613 1724 mainwin->userEventTabDlg->tabIsSelected(this))))) 1614 1725 { 1615 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R);1616 1726 if (u != NULL && u->NewMessages() > 0) 1617 1727 { … … 1627 1737 u->EventClearId(idList[i]); 1628 1738 } 1629 gUserManager.DropUser(u);1630 }1739 } 1740 gUserManager.DropUser(u); 1631 1741 QWidget::windowActivationChange(oldActive); 1632 1742 } … … 1661 1771 void UserSendCommon::trySecure() 1662 1772 { 1773 #ifdef QT_PROTOCOL_PLUGIN 1774 ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R); 1775 #else 1663 1776 ICQUser *u = gUserManager.FetchUser(m_nUin, LOCK_R); 1777 #endif 1664 1778 bool autoSecure = ( u->AutoSecure() && gLicqDaemon->CryptoEnabled() && 1665 1779 (u->SecureChannelSupport() == SECURE_CHANNEL_SUPPORTED ) && … … 1669 1783 connect(btnSend, SIGNAL(clicked()), this, SLOT(sendButton())); 1670 1784 if ( autoSecure ) { 1785 #ifdef QT_PROTOCOL_PLUGIN 1786 QWidget *w = new KeyRequestDlg(sigman, m_szId, m_nPPID); 1787 #else 1671 1788 QWidget* w = new KeyRequestDlg(sigman, m_nUin); 1789 #endif 1672 1790 connect(w, SIGNAL( destroyed() ), this, SLOT( sendButton() ) ); 1673 1791 } … … 1704 1822 switch(id) 1705 1823 { 1824 #ifdef QT_PROTOCOL_PLUGIN 1825 case 0: 1826 e = new UserSendMsgEvent(server, sigman, mainwin, m_szId, m_nPPID); 1827 break; 1828 case 1: 1829 e = new UserSendUrlEvent(server, sigman, mainwin, m_szId, m_nPPID); 1830 break; 1831 case 2: 1832 e = new UserSendChatEvent(server, sigman, mainwin, m_szId, m_nPPID); 1833 break; 1834 case 3: 1835 e = new UserSendFileEvent(server, sigman, mainwin, m_szId, m_nPPID); 1836 break; 1837 case 4: 1838 e = new UserSendContactEvent(server, sigman, mainwin, m_szId, m_nPPID); 1839 break; 1840 case 5: 1841 e = new UserSendSmsEvent(server, sigman, mainwin, m_szId, m_nPPID); 1842 break; 1843 #else 1706 1844 case 0: 1707 1845 e = new UserSendMsgEvent(server, sigman, mainwin, m_nUin, parent); … … 1722 1860 e = new UserSendSmsEvent(server, sigman, mainwin, m_nUin, parent); 1723 1861 break; 1862 #endif 1724 1863 } 1725 1864 … … 1727 1866 { 1728 1867 if (e->mleSend && mleSend) 1729 { 1868 { 1730 1869 e->mleSend->setText(mleSend->text()); 1731 1870 e->mleSend->setEdited(e->mleSend->length()); … … 1843 1982 { 1844 1983 if(!mainwin->m_bManualNewUser) { 1984 #ifdef QT_PROTOCOL_PLUGIN 1985 ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_W); 1986 #else 1845 1987 ICQUser* u = gUserManager.FetchUser(m_nUin, LOCK_W); 1988 #endif 1846 1989 1847 1990 if(u->NewUser()) … … 1849 1992 u->SetNewUser(false); 1850 1993 gUserManager.DropUser(u); 1851 1994 #ifdef QT_PROTOCOL_PLUGIN 1995 CICQSignal s(SIGNAL_UPDATExUSER, USER_BASIC, m_szId, m_nPPID); 1996 #else 1852 1997 CICQSignal s(SIGNAL_UPDATExUSER, USER_BASIC, m_nUin); 1998 #endif 1853 1999 emit updateUser(&s); 1854 2000 } … … 1980 2126 if (e->SubResult() == ICQ_TCPxACK_RETURN) 1981 2127 { 2128 #ifdef QT_PROTOCOL_PLUGIN 2129 u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_W); 2130 #else 1982 2131 u = gUserManager.FetchUser(m_nUin, LOCK_W); 2132 #endif 1983 2133 msg = tr("%1 is in %2 mode:\n%3\nSend...") 1984 2134 .arg(codec->toUnicode(u->GetAlias())).arg(u->StatusStr()) … … 2002 2152 else if (e->SubResult() == ICQ_TCPxACK_REFUSE) 2003 2153 {
