Changeset 6306
- Timestamp:
- 06/14/08 17:36:23 (7 months ago)
- Location:
- trunk/licq
- Files:
-
- 9 modified
-
include/licq_icqd.h (modified) (3 diffs)
-
include/licq_packets.h (modified) (1 diff)
-
src/fifo.cpp (modified) (2 diffs)
-
src/icqd-srv.cpp (modified) (36 diffs)
-
src/icqd-tcp.cpp (modified) (9 diffs)
-
src/icqd-threads.cpp (modified) (1 diff)
-
src/icqd.cpp (modified) (14 diffs)
-
src/icqpacket.cpp (modified) (7 diffs)
-
src/user.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/licq/include/licq_icqd.h
r6282 r6306 452 452 void icqRequestAuth(unsigned long _nUin, const char *_szMessage); 453 453 void icqAlertUser(unsigned long _nUin); 454 void icqAlertUser(const char* id, unsigned long ppid); 454 455 void icqAddUser(unsigned long _nUin, bool _bAuthReq = false); 455 456 void icqAddUser(const char *_szId, bool _bAuthReq = false); … … 785 786 bool AddUserEvent(ICQUser *, CUserEvent *); 786 787 void RejectEvent(unsigned long, CUserEvent *); 788 void RejectEvent(const char* id, CUserEvent* e); 787 789 ICQUser *FindUserForInfoUpdate(const char *szId, ICQEvent *e, const char *); 788 790 unsigned long FindUinByCellular(const char *_szCellular); … … 820 822 ICQEvent *SendExpectEvent_Server(unsigned long nUin, CPacket *, CUserEvent *, bool = false); 821 823 ICQEvent *SendExpectEvent_Server(const char *, unsigned long, CPacket *, CUserEvent *, bool = false); 824 825 ICQEvent* SendExpectEvent_Server(CPacket* packet, CUserEvent* ue, bool extendedEvent = false) 826 { return SendExpectEvent_Server("0", LICQ_PPID, packet, ue, extendedEvent); } 827 822 828 ICQEvent *SendExpectEvent_Client(ICQUser *, CPacket *, CUserEvent *); 823 829 ICQEvent *SendExpectEvent(ICQEvent *, void *(*fcn)(void *)); -
trunk/licq/include/licq_packets.h
r6282 r6306 816 816 void InitBuffer(); 817 817 818 unsigned long m_n Uin, m_nMsgID[2];818 unsigned long m_nMsgID[2]; 819 819 unsigned short m_nSequence, m_nMsgType, m_nStatus, m_nUinLen, m_nLevel; 820 820 char m_szUin[13]; -
trunk/licq/src/fifo.cpp
r6271 r6306 305 305 if( strcasecmp(s, pUser->GetAlias()) == 0) 306 306 { 307 _szId = (char *) malloc(26); 308 if( _szId ) 309 { 310 sprintf(_szId, "%ld", pUser->Uin() ); 311 ret = true; 312 } 307 _szId = strdup(pUser->IdString()); 308 ret = true; 313 309 FOR_EACH_PROTO_USER_BREAK 314 310 } … … 593 589 else 594 590 { 595 unsigned long nUin = u->Uin();596 591 gUserManager.DropUser(u); 597 d->icqRequestMetaInfo( nUin);592 d->icqRequestMetaInfo(szId); 598 593 ret = 0; 599 594 } -
trunk/licq/src/icqd-srv.cpp
r6282 r6306 98 98 gLog.Info(tr("%sAdding %s to server list...\n"), L_SRVxSTR, _szId); 99 99 addToModifyUsers(pAdd->SubSequence(), _szId); 100 SendExpectEvent_Server( 0,pAdd, NULL);100 SendExpectEvent_Server(pAdd, NULL); 101 101 102 102 CSrvPacketTcp *pEnd = new CPU_GenericFamily(ICQ_SNACxFAM_LIST, … … 221 221 addToModifyUsers(pReply->SubSequence(), ""); 222 222 gLog.Info(tr("%sUpdating top level group.\n"), L_SRVxSTR); 223 SendExpectEvent_Server( 0,pReply, NULL);223 SendExpectEvent_Server(pReply, NULL); 224 224 225 225 FOR_EACH_GROUP_START(LOCK_R) … … 232 232 gLog.Info(tr("%sUpdating group %s.\n"), L_SRVxSTR, gname); 233 233 addToModifyUsers(pReply->SubSequence(), ""); 234 SendExpectEvent_Server( 0,pReply, NULL);234 SendExpectEvent_Server(pReply, NULL); 235 235 } 236 236 } … … 251 251 gLog.Info(tr("%sAdding group %s (%d) to server list ...\n"), L_SRVxSTR, _szName, nGSID); 252 252 addToModifyUsers(pAdd->SubSequence(), _szName); 253 SendExpectEvent_Server( 0L,pAdd, NULL);253 SendExpectEvent_Server(pAdd, NULL); 254 254 } 255 255 … … 288 288 nSID, _nOldType); 289 289 addToModifyUsers(pRemove->SubSequence(), _szId); 290 SendExpectEvent_Server( 0,pRemove, NULL);290 SendExpectEvent_Server(pRemove, NULL); 291 291 292 292 // Add the user, with the new group … … 294 294 _nNewGroup); 295 295 addToModifyUsers(pAdd->SubSequence(), _szId); 296 SendExpectEvent_Server( 0,pAdd, NULL);296 SendExpectEvent_Server(pAdd, NULL); 297 297 298 298 } … … 312 312 // to add a flag to signify if it is a real user/group or a generic one. 313 313 addToModifyUsers(pExport->SubSequence(), ""); 314 SendExpectEvent_Server( 0,pExport, NULL);314 SendExpectEvent_Server(pExport, NULL); 315 315 316 316 CSrvPacketTcp *pEnd = new CPU_GenericFamily(ICQ_SNACxFAM_LIST, … … 368 368 pRemove = new CPU_RemoveFromServerList(_szId, nGSID, nSID, ICQ_ROSTxNORMAL); 369 369 addToModifyUsers(pRemove->SubSequence(), _szId); 370 SendExpectEvent_Server( 0,pRemove, NULL);370 SendExpectEvent_Server(pRemove, NULL); 371 371 372 372 if (nVisibleSID) … … 404 404 void CICQDaemon::icqRemoveUser(unsigned long _nUin) 405 405 { 406 // Remove from the SSList and update groups 407 if (UseServerContactList()) 408 { 409 CSrvPacketTcp *pStart = new CPU_GenericFamily(ICQ_SNACxFAM_LIST, 410 ICQ_SNACxLIST_ROSTxEDITxSTART); 411 SendEvent_Server(pStart); 412 413 ICQUser *u = gUserManager.FetchUser(_nUin, LOCK_W); 414 unsigned short nGSID = u->GetGSID(); 415 unsigned short nSID = u->GetSID(); 416 char szUin[13]; 417 snprintf(szUin, 12, "%lu", _nUin); 418 szUin[12] = '\0'; 419 u->SetGSID(0); 420 gUserManager.DropUser(u); 421 422 CSrvPacketTcp *pRemove = new CPU_RemoveFromServerList(szUin, nGSID, nSID, ICQ_ROSTxNORMAL); 423 addToModifyUsers(pRemove->SubSequence(), szUin); 424 SendExpectEvent_Server(0, pRemove, NULL); 425 } 426 427 // Tell server they are no longer with us. 428 CSrvPacketTcp *p = new CPU_GenericUinList(_nUin, ICQ_SNACxFAM_BUDDY, ICQ_SNACxBDY_REMOVExFROMxLIST); 429 gLog.Info(tr("%sAlerting server to remove user (#%hu)...\n"), L_SRVxSTR, 430 p->Sequence()); 431 SendExpectEvent_Server(_nUin, p, NULL); 406 char szUin[13]; 407 snprintf(szUin, 12, "%lu", _nUin); 408 szUin[12] = 0; 409 icqRemoveUser(szUin); 432 410 } 433 411 … … 445 423 gLog.Info(tr("%sRemoving group from server side list (%s)...\n"), L_SRVxSTR, _szName); 446 424 addToModifyUsers(pRemove->SubSequence(), _szName); 447 SendExpectEvent_Server( 0,pRemove, NULL);425 SendExpectEvent_Server(pRemove, NULL); 448 426 } 449 427 … … 458 436 _szNewName); 459 437 addToModifyUsers(pUpdate->SubSequence(), _szNewName); 460 SendExpectEvent_Server( 0,pUpdate, NULL);438 SendExpectEvent_Server(pUpdate, NULL); 461 439 } 462 440 … … 491 469 gLog.Info(tr("%sRenaming %s to %s...\n"), L_SRVxSTR, _szId, szNewAlias); 492 470 addToModifyUsers(pUpdate->SubSequence(), _szId); 493 SendExpectEvent_Server( 0,pUpdate, NULL);471 SendExpectEvent_Server(pUpdate, NULL); 494 472 } 495 473 496 474 //-----icqAlertUser------------------------------------------------------------- 497 475 void CICQDaemon::icqAlertUser(unsigned long _nUin) 476 { 477 char szUin[13]; 478 snprintf(szUin, 12, "%lu", _nUin); 479 szUin[12] = '\0'; 480 icqAlertUser(szUin, LICQ_PPID); 481 } 482 483 void CICQDaemon::icqAlertUser(const char* id, unsigned long ppid) 498 484 { 499 485 ICQOwner *o = gUserManager.FetchOwner(LOCK_R); … … 503 489 o->GetAuthorization() ? '0' : '1', 0xFE); 504 490 gUserManager.DropOwner(); 505 CPU_ThroughServer *p = new CPU_ThroughServer( _nUin, ICQ_CMDxSUB_ADDEDxTOxLIST, sz);491 CPU_ThroughServer *p = new CPU_ThroughServer(id, ICQ_CMDxSUB_ADDEDxTOxLIST, sz); 506 492 gLog.Info(tr("%sAlerting user they were added (#%hu)...\n"), L_SRVxSTR, p->Sequence()); 507 SendExpectEvent_Server(_nUin, p, NULL); 508 } 509 493 SendExpectEvent_Server(id, ppid, p, NULL); 494 } 510 495 //-----icqFetchAutoResponseServer----------------------------------------------- 511 496 unsigned long CICQDaemon::ProtoFetchAutoResponseServer(const char *_szId, unsigned long _nPPID) … … 578 563 p->Sequence()); 579 564 580 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);565 ICQEvent* e = SendExpectEvent_Server(p, NULL); 581 566 if (e != NULL) 582 567 return e->EventId(); … … 591 576 p->Sequence()); 592 577 593 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);578 ICQEvent* e = SendExpectEvent_Server(p, NULL); 594 579 if (e != NULL) 595 580 return e->EventId(); … … 622 607 CPU_Register *p = new CPU_Register(m_szRegisterPasswd); 623 608 gLog.Info(tr("%sRegistering a new user...\n"), L_SRVxSTR); 624 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);609 ICQEvent* e = SendExpectEvent_Server(p, NULL); 625 610 if (e != NULL) 626 611 e->thread_plugin = m_nRegisterThreadId; … … 646 631 szVerification); 647 632 gLog.Info(tr("%sSending verification for registration.\n"), L_SRVxSTR); 648 649 SendExpectEvent_Server( 0,p, NULL);633 634 SendExpectEvent_Server(p, NULL); 650 635 } 651 636 … … 832 817 gLog.Info(tr("%sUpdating password (#%hu/#%d)...\n"), L_SRVxSTR, 833 818 p->Sequence(), p->SubSequence()); 834 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);819 ICQEvent* e = SendExpectEvent_Server(p, NULL); 835 820 if (e != NULL) 836 821 return e->EventId(); … … 881 866 gLog.Info(tr("%sUpdating general info (#%hu/#%d)...\n"), L_SRVxSTR, p->Sequence(), p->SubSequence()); 882 867 883 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);868 ICQEvent* e = SendExpectEvent_Server(p, NULL); 884 869 if (e != NULL) 885 870 return e->EventId(); … … 897 882 gLog.Info(tr("%sUpdating additional E-Mail info (#%hu/#%d)...\n"), L_SRVxSTR, p->Sequence(), p->SubSequence()); 898 883 899 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);884 ICQEvent* e = SendExpectEvent_Server(p, NULL); 900 885 if (e != NULL) 901 886 return e->EventId(); … … 918 903 gLog.Info(tr("%sUpdating more info (#%hu/#%d)...\n"), L_SRVxSTR, p->Sequence(), p->SubSequence()); 919 904 920 ICQEvent *e = SendExpectEvent_Server( 0,p, NULL);905 ICQEvent *e = SendExpectEvent_Server(p, NULL); 921 906 if (e != NULL) 922 907 return e->EventId(); … … 931 916 p->Sequence(), p->SubSequence()); 932 917 933 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);918 ICQEvent* e = SendExpectEvent_Server(p, NULL); 934 919 if (e != NULL) 935 920 return e->EventId(); … … 946 931 L_SRVxSTR, p->Sequence(), p->SubSequence()); 947 932 948 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);933 ICQEvent* e = SendExpectEvent_Server(p, NULL); 949 934 if (e != NULL) 950 935 return e->EventId(); … … 968 953 gLog.Info(tr("%sUpdating work info (#%hu/#%d)...\n"), L_SRVxSTR, p->Sequence(), p->SubSequence()); 969 954 970 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);955 ICQEvent* e = SendExpectEvent_Server(p, NULL); 971 956 if (e != NULL) 972 957 return e->EventId(); … … 985 970 delete [] szAbout; 986 971 987 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);972 ICQEvent* e = SendExpectEvent_Server(p, NULL); 988 973 if (e != NULL) 989 974 return e->EventId(); … … 1057 1042 delete [] sz; 1058 1043 1059 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);1044 ICQEvent* e = SendExpectEvent_Server(p, NULL); 1060 1045 if (e != NULL) 1061 1046 return e->EventId(); … … 1090 1075 CPU_Meta_SetSecurityInfo *p = new CPU_Meta_SetSecurityInfo(bAuthorize, bHideIp, bWebAware); 1091 1076 gLog.Info(tr("%sUpdating security info (#%hu/#%d)...\n"), L_SRVxSTR, p->Sequence(), p->SubSequence()); 1092 ICQEvent *e = SendExpectEvent_Server(0,p, NULL);1077 ICQEvent* e = SendExpectEvent_Server(p, NULL); 1093 1078 if (e != NULL) 1094 1079 return e->EventId(); … … 1112 1097 gLog.Info(tr("%sStarting white pages search (#%hu/#%d)...\n"), L_SRVxSTR, 1113 1098 p->Sequence(), p->SubSequence()); 1114 ICQEvent *e = SendExpectEvent_Server( 0,p, NULL, true);1099 ICQEvent *e = SendExpectEvent_Server(p, NULL, true); 1115 1100 if (e != NULL) 1116 1101 return e->EventId(); … … 1124 1109 gLog.Info(tr("%sStarting search by UIN for user (#%hu/#%d)...\n"), L_SRVxSTR, 1125 1110 p->Sequence(), p->SubSequence()); 1126 ICQEvent *e = SendExpectEvent_Server(0,p, NULL, true);1111 ICQEvent* e = SendExpectEvent_Server(p, NULL, true); 1127 1112 if (e != NULL) 1128 1113 return e->EventId(); … … 1423 1408 CSrvPacketTcp *pAdd = new CPU_AddToServerList(_szId, ICQ_ROSTxVISIBLE); 1424 1409 addToModifyUsers(pAdd->SubSequence(), _szId); 1425 SendExpectEvent_Server( 0,pAdd, NULL);1410 SendExpectEvent_Server(pAdd, NULL); 1426 1411 } 1427 1412 } … … 2373 2358 gLog.Info(tr("%sRequesting list rights.\n"), L_SRVxSTR); 2374 2359 p = new CPU_ListRequestRights(); 2375 SendExpectEvent_Server( 0,p, NULL);2360 SendExpectEvent_Server(p, NULL); 2376 2361 2377 2362 gLog.Info(tr("%sRequesting roster rights.\n"), L_SRVxSTR); … … 3230 3215 if (ignore) 3231 3216 { 3232 RejectEvent(s trtoul(szId, (char **)NULL, 10), e);3217 RejectEvent(szId, e); 3233 3218 break; 3234 3219 } … … 3796 3781 3797 3782 //TODO 3798 RejectEvent(s trtoul(szId, (char **)NULL, 10), eEvent);3783 RejectEvent(szId, eEvent); 3799 3784 break; 3800 3785 } … … 4554 4539 } 4555 4540 addToModifyUsers(pReply->SubSequence(), groupName); 4556 SendExpectEvent_Server( 0,pReply, NULL);4541 SendExpectEvent_Server(pReply, NULL); 4557 4542 4558 4543 // Finish editing server list … … 4594 4579 ICQ_ROSTxNORMAL, 0, true); 4595 4580 addToModifyUsers(pReply->SubSequence(), pending); 4596 SendExpectEvent_Server( 0,pReply, NULL);4581 SendExpectEvent_Server(pReply, NULL); 4597 4582 } 4598 4583 } … … 5613 5598 5614 5599 if (bNewUser) 5615 { 5616 icqRequestMetaInfo(nUin); 5617 } 5600 icqRequestMetaInfo(szUin); 5618 5601 5619 5602 e->m_pSearchAck = new CSearchAck(nUin); -
trunk/licq/src/icqd-tcp.cpp
r6181 r6306 682 682 { 683 683 CPU_InfoPluginReq *p = new CPU_InfoPluginReq(u, GUID, 0); 684 result = SendExpectEvent_Server(u-> Uin(), p, NULL);684 result = SendExpectEvent_Server(u->IdString(), u->PPID(), p, NULL); 685 685 } 686 686 else … … 1063 1063 u->GetAlias(), -p->Sequence()); 1064 1064 1065 result = SendExpectEvent_Server(u-> Uin(), p, e);1065 result = SendExpectEvent_Server(u->IdString(), u->PPID(), p, e); 1066 1066 } 1067 1067 else … … 1578 1578 1579 1579 char szAlias[64]; 1580 snprintf(szAlias, sizeof(szAlias), "%s (% lu)", u->GetAlias(), u->Uin());1580 snprintf(szAlias, sizeof(szAlias), "%s (%s)", u->GetAlias(), u->IdString()); 1581 1581 szAlias[sizeof(szAlias) - 1] = '\0'; 1582 1582 unsigned long ip = u->Ip(); … … 1916 1916 if (u->SocketDesc(pSock->Channel()) != sockfd) 1917 1917 { 1918 gLog.Warn("%sUser %s (% lu) socket (%d) does not match incoming message (%d).\n",1919 L_TCPxSTR, u->GetAlias(), u-> Uin(),1918 gLog.Warn("%sUser %s (%s) socket (%d) does not match incoming message (%d).\n", 1919 L_TCPxSTR, u->GetAlias(), u->IdString(), 1920 1920 u->SocketDesc(pSock->Channel()), sockfd); 1921 1921 } … … 2017 2017 bool r = u->OfflineOnDisconnect() || u->StatusOffline(); 2018 2018 ChangeUserStatus(u, (u->StatusFull() & ICQ_STATUS_FxFLAGS) | ns); 2019 gLog.Info(tr("%s%s (% ld) is %s to us.\n"), L_TCPxSTR, u->GetAlias(),2020 u-> Uin(), u->StatusStr());2019 gLog.Info(tr("%s%s (%s) is %s to us.\n"), L_TCPxSTR, u->GetAlias(), 2020 u->IdString(), u->StatusStr()); 2021 2021 if (r) u->SetOfflineOnDisconnect(true); 2022 2022 } … … 3303 3303 3304 3304 PushPluginSignal(new CICQSignal(SIGNAL_UPDATExUSER, USER_PICTURE, 3305 u->Uin())); 3306 3307 3305 u->IdString(), u->PPID())); 3308 3306 } 3309 3307 else if (memcmp(GUID, PLUGIN_QUERYxINFO, GUID_LENGTH) == 0) … … 3431 3429 3432 3430 PushPluginSignal(new CICQSignal(SIGNAL_UPDATExUSER, USER_PHONExBOOK, 3433 u->Uin()));3431 u->IdString(), u->PPID())); 3434 3432 3435 3433 break; … … 3472 3470 3473 3471 PushPluginSignal(new CICQSignal(SIGNAL_UPDATExUSER, USER_PICTURE, 3474 u->Uin()));3472 u->IdString(), u->PPID())); 3475 3473 3476 3474 break; … … 3754 3752 3755 3753 // Which plugin? 3756 PushPluginSignal(new CICQSignal(SIGNAL_UPDATExUSER, 3757 USER_PLUGIN_STATUS, u->Uin(), 0));3754 PushPluginSignal(new CICQSignal(SIGNAL_UPDATExUSER, USER_PLUGIN_STATUS, 3755 u->IdString(), u->PPID(), 0)); 3758 3756 3759 3757 ProcessDoneEvent(e); -
trunk/licq/src/icqd-threads.cpp
r6181 r6306 1002 1002 && pUser->ClientTimestamp() != 0) 1003 1003 { 1004 d->icqRequestMetaInfo(pUser-> Uin());1004 d->icqRequestMetaInfo(pUser->IdString()); 1005 1005 bSent = true; 1006 1006 } -
trunk/licq/src/icqd.cpp
r6248 r6306 1208 1208 if (nUin == 0) return false; 1209 1209 1210 // Don't add a user we already have 1211 if (gUserManager.IsOnList(nUin)) 1212 { 1213 gLog.Warn(tr("%sUser %lu already on contact list.\n"), L_WARNxSTR, nUin); 1214 return false; 1215 } 1216 1217 ICQUser *u = new ICQUser(nUin); 1218 gUserManager.AddUser(u); 1219 gUserManager.DropUser(u); 1220 SaveUserList(); 1221 1222 // this notify is for local only adds 1223 if (m_nTCPSrvSocketDesc != -1 && bNotify) icqAddUser(nUin); 1224 1225 PushPluginSignal(new CICQSignal(SIGNAL_UPDATExLIST, LIST_ADD, nUin)); 1226 1227 return true; 1210 char szUin[24]; 1211 sprintf(szUin, "%lu", nUin); 1212 return AddUserToList(szUin, LICQ_PPID, bNotify); 1228 1213 } 1229 1214 … … 1268 1253 void CICQDaemon::RemoveUserFromList(unsigned long _nUin) 1269 1254 { 1270 if (m_nTCPSrvSocketDesc != -1) icqRemoveUser(_nUin); 1271 1272 gUserManager.RemoveUser(_nUin); 1273 SaveUserList(); 1274 1275 PushPluginSignal(new CICQSignal(SIGNAL_UPDATExLIST, LIST_REMOVE, _nUin)); 1255 char szUin[24]; 1256 sprintf(szUin, "%lu", _nUin); 1257 RemoveUserFromList(szUin, LICQ_PPID); 1276 1258 } 1277 1259 … … 1370 1352 void CICQDaemon::RejectEvent(unsigned long nUin, CUserEvent *e) 1371 1353 { 1354 char szUin[24]; 1355 sprintf(szUin, "%lu", nUin); 1356 RejectEvent(szUin, e); 1357 } 1358 1359 void CICQDaemon::RejectEvent(const char* id, CUserEvent* e) 1360 { 1372 1361 if (m_szRejectFile == NULL) return; 1373 1362 … … 1379 1368 else 1380 1369 { 1381 fprintf(f, "Event from new user (% lu) rejected: \n%s\n--------------------\n\n",1382 nUin, e->Text());1370 fprintf(f, "Event from new user (%s) rejected: \n%s\n--------------------\n\n", 1371 id, e->Text()); 1383 1372 chmod(m_szRejectFile, 00600); 1384 1373 fclose(f); … … 1478 1467 CUserEvent *ue, bool bExtendedEvent) 1479 1468 { 1469 char szUin[24]; 1470 sprintf(szUin, "%lu", nUin); 1471 return SendExpectEvent_Server(szUin, LICQ_PPID, packet, ue, bExtendedEvent); 1472 } 1473 1474 ICQEvent *CICQDaemon::SendExpectEvent_Client(ICQUser *pUser, CPacket *packet, 1475 CUserEvent *ue) 1476 { 1480 1477 // If we are already shutting down, don't start any events 1481 1478 if (m_bShuttingDown) … … 1487 1484 1488 1485 if (ue != NULL) ue->m_eDir = D_SENDER; 1489 ICQEvent *e = new ICQEvent(this, m_nTCPSrvSocketDesc, packet, CONNECT_SERVER, nUin, ue);1490 1491 if (e == NULL) return NULL;1492 1493 if (bExtendedEvent) PushExtendedEvent(e);1494 1495 ICQEvent *result = SendExpectEvent(e, &ProcessRunningEvent_Server_tep);1496 1497 // if an error occured, remove the event from the extended queue as well1498 if (result == NULL && bExtendedEvent)1499 {1500 pthread_mutex_lock(&mutex_extendedevents);1501 std::list<ICQEvent *>::iterator i;1502 for (i = m_lxExtendedEvents.begin(); i != m_lxExtendedEvents.end(); ++i)1503 {1504 if (*i == e)1505 {1506 m_lxExtendedEvents.erase(i);1507 break;1508 }1509 }1510 pthread_mutex_unlock(&mutex_extendedevents);1511 }1512 1513 return result;1514 }1515 1516 1517 ICQEvent *CICQDaemon::SendExpectEvent_Client(ICQUser *pUser, CPacket *packet,1518 CUserEvent *ue)1519 {1520 // If we are already shutting down, don't start any events1521 if (m_bShuttingDown)1522 {1523 if (packet != NULL) delete packet;1524 if (ue != NULL) delete ue;1525 return NULL;1526 }1527 1528 if (ue != NULL) ue->m_eDir = D_SENDER;1529 1486 ICQEvent *e = new ICQEvent(this, pUser->SocketDesc(packet->Channel()), packet, 1530 CONNECT_USER, pUser-> Uin(), ue);1487 CONNECT_USER, pUser->IdString(), pUser->PPID(), ue); 1531 1488 1532 1489 if (e == NULL) return NULL; … … 2281 2238 icqChatRequestCancel(e->m_nDestinationUin, e->m_nSequence); 2282 2239 else if (e->m_nSubCommand == ICQ_CMDxSUB_FILE) 2283 icqFileTransferCancel(e-> m_nDestinationUin, e->m_nSequence);2240 icqFileTransferCancel(e->Id(), e->m_nSequence); 2284 2241 else if (e->m_nSubCommand == ICQ_CMDxSUB_SECURExOPEN) 2285 icqOpenSecureChannelCancel(e-> m_nDestinationUin, e->m_nSequence);2242 icqOpenSecureChannelCancel(e->Id(), e->m_nSequence); 2286 2243
