Changeset 6419
- Timestamp:
- 07/04/08 06:16:26 (3 months ago)
- Location:
- trunk/licq
- Files:
-
- 3 modified
-
include/licq_chat.h (modified) (10 diffs)
-
include/licq_icqd.h (modified) (12 diffs)
-
src/icqd-chat.cpp (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/licq/include/licq_chat.h
r6405 r6419 2 2 #define CHAT_H 3 3 4 #include <cstdlib> 4 5 #include <deque> 5 6 #include <list> … … 8 9 #include "licq_socket.h" 9 10 class CICQDaemon; 11 12 // Define for marking functions as deprecated 13 #ifndef LICQ_DEPRECATED 14 # if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)) 15 # define LICQ_DEPRECATED __attribute__ ((__deprecated__)) 16 # elif defined(_MSC_VER) && (_MSC_VER >= 1300) 17 # define LICQ_DEPRECATED __declspec(deprecated) 18 # else 19 # define LICQ_DEPRECATED 20 # endif 21 #endif 10 22 11 23 … … 201 213 // Accessors 202 214 const char *Name() { return m_szName; } 203 unsigned long Uin() { return m_nUin; }204 215 char *Id() { return m_szId; } 205 216 unsigned long PPID() { return m_nPPID; } … … 214 225 virtual ~CPChat_Color(); 215 226 216 protected: 217 unsigned long m_nUin; 227 // Deprecated functions, to be removed 228 LICQ_DEPRECATED unsigned long Uin() { return strtoul(m_szId, NULL, 10); } 229 230 protected: 218 231 char *m_szId; 219 232 unsigned long m_nPPID; … … 250 263 unsigned long m_nVersion; 251 264 unsigned short m_nPort; 252 unsigned long m_nUin;253 265 char *m_szId; 254 266 unsigned long m_nPPID; … … 292 304 // Accessors 293 305 const char *Name() { return m_szName; } 294 unsigned long Uin() { return m_nUin; }295 306 char *Id() { return m_szId; } 296 307 unsigned long PPID() { return m_nPPID; } … … 314 325 ChatClientList &ChatClients() { return chatClients; } 315 326 316 protected: 317 unsigned long m_nUin; 327 // Deprecated functions, to be removed 328 LICQ_DEPRECATED unsigned long Uin() { return strtoul(m_szId, NULL, 10); } 329 330 protected: 318 331 char *m_szId; 319 332 unsigned long m_nPPID; … … 475 488 { 476 489 public: 477 unsigned long Uin() { return uin; }478 490 char *Id() { return szId; } 479 491 unsigned long PPID() { return nPPID; } … … 495 507 ~CChatUser(); 496 508 509 // Deprecated functions, to be removed 510 LICQ_DEPRECATED unsigned long Uin() { return strtoul(szId, NULL, 10); } 511 497 512 protected: 498 513 CChatUser(); 499 514 500 unsigned long uin;501 515 char *szId; 502 516 unsigned long nPPID; … … 621 635 CICQDaemon *licqDaemon; 622 636 int pipe_events[2], pipe_thread[2]; 623 unsigned long m_nUin;624 637 char *m_szId; 625 638 unsigned long m_nPPID; -
trunk/licq/include/licq_icqd.h
r6405 r6419 37 37 class CMSN; 38 38 39 // Define for marking functions as deprecated 40 #ifndef LICQ_DEPRECATED 41 # if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)) 42 # define LICQ_DEPRECATED __attribute__ ((__deprecated__)) 43 # elif defined(_MSC_VER) && (_MSC_VER >= 1300) 44 # define LICQ_DEPRECATED __declspec(deprecated) 45 # else 46 # define LICQ_DEPRECATED 47 # endif 48 #endif 49 50 39 51 #define FOR_EACH_PROTO_PLUGIN_START(d) \ 40 52 { \ … … 331 343 CICQColor *pColor = NULL); 332 344 333 unsigned long icqSendMessage(unsigned long nUin, const char *szMessage,334 bool bOnline, unsigned short nLevel, bool bMultipleRecipients = false,335 CICQColor *pColor = NULL);336 345 // Url 337 346 unsigned long icqSendUrl(const char *szId, const char *szUrl, … … 343 352 CICQColor *pColor = NULL); 344 353 345 unsigned long icqSendContactList(unsigned long nUin, UinList &uins,346 bool bOnline, unsigned short nLevel, bool bMultipleRecipients = false,347 CICQColor *pColor = NULL);348 354 // Auto Response 349 unsigned long icqFetchAutoResponse(unsigned long nUin, bool bServer = false) __attribute__ ((deprecated));350 355 unsigned long icqFetchAutoResponse(const char *_szId, unsigned long _nPPID, bool bServer = false); 351 356 // Chat Request 352 357 unsigned long icqChatRequest(const char* id, const char *szReason, 353 358 unsigned short nLevel, bool bServer); 354 unsigned long icqChatRequest(unsigned long nUin, const char *szReason,355 unsigned short nLevel, bool bServer);356 359 unsigned long icqMultiPartyChatRequest(const char* id, 357 const char *szReason, const char *szChatUsers, unsigned short nPort,358 unsigned short nLevel, bool bServer);359 unsigned long icqMultiPartyChatRequest(unsigned long nUin,360 360 const char *szReason, const char *szChatUsers, unsigned short nPort, 361 361 unsigned short nLevel, bool bServer); 362 362 void icqChatRequestRefuse(const char* id, const char* szReason, 363 363 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect); 364 void icqChatRequestRefuse(unsigned long nUin, const char *szReason,365 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect);366 364 void icqChatRequestAccept(const char* id, unsigned short nPort, 367 365 const char* szClients, unsigned short nSequence, 368 366 const unsigned long nMsgID[], bool bDirect); 369 void icqChatRequestAccept(unsigned long nUin, unsigned short nPort,370 const char* szClients, unsigned short nSequence,371 const unsigned long nMsgID[], bool bDirect);372 367 void icqChatRequestCancel(const char* id, unsigned short nSequence); 373 void icqChatRequestCancel(unsigned long nUin, unsigned short nSequence);374 368 // File Transfer 375 369 unsigned long icqFileTransfer(const char *szId, const char *szFilename, 376 370 const char *szDescription, ConstFileList &lFileList, 377 371 unsigned short nLevel, bool bServer); 378 unsigned long icqFileTransfer(unsigned long nUin, const char *szFilename,379 const char *szDescription, ConstFileList &lFileList,380 unsigned short nLevel, bool bServer);381 372 void icqFileTransferRefuse(const char *szId, const char *szReason, 382 373 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect); 383 void icqFileTransferRefuse(unsigned long nUin, const char *szReason,384 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect);385 374 void icqFileTransferCancel(const char *szId, unsigned short nSequence); 386 void icqFileTransferCancel(unsigned long nUin, unsigned short nSequence);387 375 void icqFileTransferAccept(const char *szId, unsigned short nPort, 388 376 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect, 389 377 const char *szDesc, const char *szFile, unsigned long nFileSize); 390 void icqFileTransferAccept(unsigned long nUin, unsigned short nPort,391 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect,392 const char *szDesc, const char *szFile, unsigned long nFileSize);393 378 unsigned long icqOpenSecureChannel(const char *szId); 394 unsigned long icqOpenSecureChannel(unsigned long nUin);395 379 unsigned long icqCloseSecureChannel(const char *szId); 396 unsigned long icqCloseSecureChannel(unsigned long nUin);397 380 void icqOpenSecureChannelCancel(const char *szId, unsigned short nSequence); 398 void icqOpenSecureChannelCancel(unsigned long nUin, unsigned short nSequence);399 381 400 382 // Plugins … … 415 397 void icqVerify(const char *); 416 398 unsigned long icqFetchAutoResponseServer(const char *); 417 unsigned long icqFetchAutoResponseServer(unsigned long);418 399 unsigned long icqLogon(unsigned short logonStatus); 419 400 unsigned long icqRequestLogonSalt(); 420 401 unsigned long icqUserBasicInfo(const char *); 421 unsigned long icqUserBasicInfo(unsigned long);422 402 unsigned long icqUserExtendedInfo(const char *); 423 unsigned long icqUserExtendedInfo(unsigned long);424 403 unsigned long icqRequestMetaInfo(const char *); 425 unsigned long icqRequestMetaInfo(unsigned long);426 404 427 405 unsigned long icqUpdateBasicInfo(const char *, const char *, const char *, … … 475 453 void postLogoff(int nSD, ICQEvent *cancelledEvent); 476 454 void icqRelogon(); 477 unsigned long icqAuthorizeGrant(unsigned long nUin, const char *szMessage);478 455 unsigned long icqAuthorizeGrant(const char *szId, const char *szMessage); 479 unsigned long icqAuthorizeRefuse(unsigned long nUin, const char *szMessage);480 456 unsigned long icqAuthorizeRefuse(const char *szId, const char *szMessage); 481 457 void icqRequestAuth(const char* id, const char *_szMessage); 482 void icqRequestAuth(unsigned long _nUin, const char *_szMessage);483 void icqAlertUser(unsigned long _nUin);484 458 void icqAlertUser(const char* id, unsigned long ppid); 485 void icqAddUser(unsigned long _nUin, bool _bAuthReq = false, unsigned short groupId = 0);486 459 void icqAddUser(const char *_szId, bool _bAuthReq = false, unsigned short groupId = 0); 487 460 void icqAddUserServer(const char *_szId, bool _bAuthReq, unsigned short groupId = 0); 488 void icqAddUserServer(unsigned long _nUin, bool _bAuthReq, unsigned short groupId = 0);489 461 void icqAddGroup(const char *); 490 void icqRemoveUser(unsigned long _nUin);491 462 void icqRemoveUser(const char *); 492 463 void icqRemoveGroup(const char *); 493 void icqChangeGroup(unsigned long _nUin, unsigned short _nNewGroup,494 unsigned short _nOldGSID, unsigned short _nNewType,495 unsigned short _nOldType);496 464 void icqChangeGroup(const char *_szId, unsigned long _nPPID, 497 465 unsigned short _nNewGroup, unsigned short _nOldGSID, 498 466 unsigned short _nNewType, unsigned short _nOldType); 499 467 void icqRenameGroup(const char *_szNewName, unsigned short _nGSID); 500 void icqRenameUser(unsigned long _nUin);501 468 void icqRenameUser(const char *_szId); 502 469 void icqExportUsers(UserStringList &, unsigned short); … … 599 566 bool AddUserToList(const char *szId, unsigned long PPID, bool bNotify = true, 600 567 bool bTempUser = false, unsigned short groupId = 0); 601 bool AddUserToList(unsigned long _nUin, bool bNotify = true,602 bool bTempUser = false, unsigned short groupId = 0);603 568 void AddUserToList(ICQUser *); 604 void RemoveUserFromList(unsigned long _nUin);605 569 void RemoveUserFromList(const char *szId, unsigned long nPPID); 606 570 … … 608 572 unsigned long icqSendSms(const char* id, unsigned long ppid, 609 573 const char* number, const char* message); 610 unsigned long icqSendSms(const char *szNumber, const char *szMessage,611 unsigned long nUin);612 574 613 575 // NOT MT SAFE … … 719 681 TCPSocket *pSock); 720 682 bool WaitForReverseConnection(unsigned short id, const char* userId); 683 684 // Deprecated functions, to be removed 685 LICQ_DEPRECATED unsigned long icqSendMessage(unsigned long nUin, const char *szMessage, 686 bool bOnline, unsigned short nLevel, bool bMultipleRecipients = false, 687 CICQColor *pColor = NULL); 688 LICQ_DEPRECATED unsigned long icqSendContactList(unsigned long nUin, UinList &uins, 689 bool bOnline, unsigned short nLevel, bool bMultipleRecipients = false, 690 CICQColor *pColor = NULL); 691 LICQ_DEPRECATED unsigned long icqFetchAutoResponse(unsigned long nUin, bool bServer = false); 692 LICQ_DEPRECATED unsigned long icqChatRequest(unsigned long nUin, const char *szReason, 693 unsigned short nLevel, bool bServer); 694 LICQ_DEPRECATED unsigned long icqMultiPartyChatRequest(unsigned long nUin, 695 const char *szReason, const char *szChatUsers, unsigned short nPort, 696 unsigned short nLevel, bool bServer); 697 LICQ_DEPRECATED void icqChatRequestRefuse(unsigned long nUin, const char *szReason, 698 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect); 699 LICQ_DEPRECATED void icqChatRequestAccept(unsigned long nUin, unsigned short nPort, 700 const char* szClients, unsigned short nSequence, 701 const unsigned long nMsgID[], bool bDirect); 702 LICQ_DEPRECATED void icqChatRequestCancel(unsigned long nUin, unsigned short nSequence); 703 LICQ_DEPRECATED unsigned long icqFileTransfer(unsigned long nUin, const char *szFilename, 704 const char *szDescription, ConstFileList &lFileList, 705 unsigned short nLevel, bool bServer); 706 LICQ_DEPRECATED void icqFileTransferRefuse(unsigned long nUin, const char *szReason, 707 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect); 708 LICQ_DEPRECATED void icqFileTransferCancel(unsigned long nUin, unsigned short nSequence); 709 LICQ_DEPRECATED void icqFileTransferAccept(unsigned long nUin, unsigned short nPort, 710 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect, 711 const char *szDesc, const char *szFile, unsigned long nFileSize); 712 LICQ_DEPRECATED unsigned long icqOpenSecureChannel(unsigned long nUin); 713 LICQ_DEPRECATED unsigned long icqCloseSecureChannel(unsigned long nUin); 714 LICQ_DEPRECATED void icqOpenSecureChannelCancel(unsigned long nUin, unsigned short nSequence); 715 LICQ_DEPRECATED unsigned long icqFetchAutoResponseServer(unsigned long); 716 LICQ_DEPRECATED unsigned long icqUserBasicInfo(unsigned long); 717 LICQ_DEPRECATED unsigned long icqUserExtendedInfo(unsigned long); 718 LICQ_DEPRECATED unsigned long icqRequestMetaInfo(unsigned long); 719 LICQ_DEPRECATED unsigned long icqAuthorizeGrant(unsigned long nUin, const char *szMessage); 720 LICQ_DEPRECATED unsigned long icqAuthorizeRefuse(unsigned long nUin, const char *szMessage); 721 LICQ_DEPRECATED void icqRequestAuth(unsigned long _nUin, const char *_szMessage); 722 LICQ_DEPRECATED void icqAlertUser(unsigned long _nUin); 723 LICQ_DEPRECATED void icqAddUser(unsigned long _nUin, bool _bAuthReq = false, unsigned short groupId = 0); 724 LICQ_DEPRECATED void icqAddUserServer(unsigned long _nUin, bool _bAuthReq, unsigned short groupId = 0); 725 LICQ_DEPRECATED void icqRemoveUser(unsigned long _nUin); 726 LICQ_DEPRECATED void icqChangeGroup(unsigned long _nUin, unsigned short _nNewGroup, 727 unsigned short _nOldGSID, unsigned short _nNewType, 728 unsigned short _nOldType); 729 LICQ_DEPRECATED void icqRenameUser(unsigned long _nUin); 730 LICQ_DEPRECATED bool AddUserToList(unsigned long _nUin, bool bNotify = true, 731 bool bTempUser = false, unsigned short groupId = 0); 732 LICQ_DEPRECATED void RemoveUserFromList(unsigned long _nUin); 733 LICQ_DEPRECATED unsigned long icqSendSms(const char *szNumber, const char *szMessage, 734 unsigned long nUin); 721 735 722 736 protected: … … 816 830 void ChangeUserStatus(ICQUser *u, unsigned long s); 817 831 bool AddUserEvent(ICQUser *, CUserEvent *); 818 void RejectEvent(unsigned long, CUserEvent *);819 832 void RejectEvent(const char* id, CUserEvent* e); 820 833 ICQUser *FindUserForInfoUpdate(const char *szId, ICQEvent *e, const char *); 821 834 std::string FindUserByCellular(const char* cellular); 822 unsigned long FindUinByCellular(const char *_szCellular);823 835 824 836 void icqRegisterFinish(); … … 830 842 ICQEvent *icqSendThroughServer(const char *szId, unsigned char format, char *_sMessage, 831 843 CUserEvent *, unsigned short = 0, size_t = 0); 832 ICQEvent* icqSendThroughServer(unsigned long nUin, unsigned char format, char *_sMessage, CUserEvent *, unsigned short = 0);833 844 void SaveUserList(); 834 845 … … 852 863 bool SendEvent(INetSocket *, CPacket &, bool); 853 864 void SendEvent_Server(CPacket *packet); 854 ICQEvent *SendExpectEvent_Server(unsigned long nUin, CPacket *, CUserEvent *, bool = false);855 865 ICQEvent *SendExpectEvent_Server(const char *, unsigned long, CPacket *, CUserEvent *, bool = false); 856 866 … … 910 920 // Helpers 911 921 void addToModifyUsers(unsigned long unique_id, const std::string data); 922 923 // Deprecated functions, to be removed 924 LICQ_DEPRECATED void RejectEvent(unsigned long nUin, CUserEvent* e); 925 LICQ_DEPRECATED unsigned long FindUinByCellular(const char *_szCellular); 926 LICQ_DEPRECATED ICQEvent* icqSendThroughServer(unsigned long nUin, 927 unsigned char format, char *_sMessage, CUserEvent *, unsigned short = 0); 928 LICQ_DEPRECATED ICQEvent *SendExpectEvent_Server(unsigned long nUin, 929 CPacket *, CUserEvent *, bool = false); 912 930 913 931 // Declare all our thread functions as friends -
trunk/licq/src/icqd-chat.cpp
r6405 r6419 52 52 m_nPort = _nLocalPort; 53 53 m_szId = strdup(gUserManager.OwnerId(LICQ_PPID).c_str()); 54 m_nUin = atol(m_szId);54 unsigned long m_nUin = atol(m_szId); 55 55 m_nPPID = LICQ_PPID; 56 56 m_nColorForeRed = nColorForeRed; … … 87 87 b.UnpackUnsignedLong(); 88 88 b.UnpackUnsignedLong(); 89 m_nUin = b.UnpackUnsignedLong();89 unsigned long m_nUin = b.UnpackUnsignedLong(); 90 90 char szUin[24]; 91 91 sprintf(szUin, "%lu", m_nUin); … … 115 115 CChatClient::CChatClient() 116 116 { 117 m_nVersion = m_n Uin = m_nPPID = m_nIp = m_nIntIp = m_nPort = m_nMode117 m_nVersion = m_nPPID = m_nIp = m_nIntIp = m_nPort = m_nMode 118 118 = m_nSession = m_nHandshake = 0; 119 119 m_szId = NULL; … … 125 125 m_nVersion = u->Version(); 126 126 m_szId = strdup(u->IdString()); 127 m_nUin = strtoul(m_szId, NULL, 10);128 127 m_nPPID = u->PPID(); 129 128 m_nIp = u->Ip(); … … 161 160 m_nVersion = p.m_nVersion; 162 161 m_nPort = p.m_nPort; 163 m_nUin = p.m_nUin;164 162 m_nPPID = p.m_nPPID; 165 163 m_nIp = p.m_nIp; … … 180 178 m_nPort = b.UnpackUnsignedShort(); 181 179 b.UnpackUnsignedShort(); 182 m_nUin = b.UnpackUnsignedLong();180 unsigned long m_nUin = b.UnpackUnsignedLong(); 183 181 char szUin[24]; 184 182 sprintf(szUin, "%lu", m_nUin); … … 204 202 m_nVersion = b.UnpackUnsignedLong(); 205 203 b.UnpackUnsignedLong(); 206 m_nUin = b.UnpackUnsignedLong();204 unsigned long m_nUin = b.UnpackUnsignedLong(); 207 205 char szUin[24]; 208 206 sprintf(szUin, "%lu", m_nUin); … … 230 228 m_nVersion = b.UnpackUnsignedLong(); 231 229 b.UnpackUnsignedLong(); 232 m_nUin = b.UnpackUnsignedLong();230 unsigned long m_nUin = b.UnpackUnsignedLong(); 233 231 char szUin[24]; 234 232 sprintf(szUin, "%lu", m_nUin); … … 253 251 254 252 m_nVersion = hand.VersionMajor(); 255 m_nUin = hand.SourceUin();253 unsigned long m_nUin = hand.SourceUin(); 256 254 char szUin[24]; 257 255 sprintf(szUin, "%lu", m_nUin); … … 276 274 277 275 m_nVersion = hand.VersionMajor(); 278 m_nUin = hand.SourceUin();276 unsigned long m_nUin = hand.SourceUin(); 279 277 char szUin[24]; 280 278 sprintf(szUin, "%lu", m_nUin); … … 306 304 m_nPort = nLocalPort; 307 305 m_szId = strdup(gUserManager.OwnerId(LICQ_PPID).c_str()); 308 m_nUin = atol(m_szId);306 unsigned long m_nUin = atol(m_szId); 309 307 m_nPPID = LICQ_PPID; 310 308 m_nColorForeRed = nColorForeRed; … … 358 356 buffer->PackUnsignedLong((*iter)->m_nVersion); 359 357 buffer->PackUnsignedLong((*iter)->m_nPort); 360 buffer->PackUnsignedLong( (*iter)->m_nUin);358 buffer->PackUnsignedLong(strtoul((*iter)->m_szId, NULL, 10)); 361 359 buffer->PackUnsignedLong((*iter)->m_nIp); 362 360 buffer->PackUnsignedLong((*iter)->m_nIntIp); … … 374 372 375 373 b.UnpackUnsignedLong(); 376 m_nUin = b.UnpackUnsignedLong();374 unsigned long m_nUin = b.UnpackUnsignedLong(); 377 375 char szUin[24]; 378 376 sprintf(szUin, "%lu", m_nUin); … … 618 616 CChatUser::CChatUser() 619 617 { 620 uin = 0;621 618 szId = 0; 622 619 nPPID = 0; … … 677 674 pipe(pipe_events); 678 675 679 m_nUin = nUin;680 676 char szUin[24]; 681 sprintf(szUin, "%lu", m_nUin);677 sprintf(szUin, "%lu", nUin); 682 678 m_szId = strdup(szUin); 683 679 m_nPPID = LICQ_PPID; … … 786 782 u->m_pClient = c; 787 783 u->m_pClient->m_nSession = m_nSession; 788 u->uin = c->m_nUin;789 784 u->szId = strdup(c->m_szId); 790 785 u->nPPID = c->m_nPPID; … … 884 879 u->m_pClient->m_nVersion = s->Version(); 885 880 u->m_pClient->m_szId = strdup(s->OwnerId()); 886 u->m_pClient->m_nUin = strtoul(u->m_pClient->m_szId, NULL, 10);887 881 u->m_pClient->m_nPPID = s->OwnerPPID(); 888 882 u->m_pClient->m_nIp = s->RemoteIp(); … … 895 889 u->m_pClient->m_nSession = 0; 896 890 897 u->uin = u->m_pClient->m_nUin;898 891 u->szId = strdup(u->m_pClient->m_szId); 899 892 u->nPPID = u->m_pClient->m_nPPID; … … 973 966 gLog.Info(tr("%sChat: Received handshake from %s [v%ld].\n"), L_TCPxSTR, 974 967 u->m_pClient->m_szId, u->sock.Version()); 975 u->uin = u->m_pClient->m_nUin;976 968 if (u->szId) free(u->szId); 977 969 u->szId = strdup(u->m_pClient->m_szId); … … 1091 1083 CPChat_ColorFont pin(u->sock.RecvBuffer()); 1092 1084 u->szId = strdup(pin.Id()); 1093 u->uin = strtoul(u->szId, NULL, 10);1094 1085 u->nPPID = pin.PPID(); 1095 1086 // m_nSession = pin.Session();
