Changeset 6180
- Timestamp:
- 2008-05-05 05:45:14 (3 months ago)
- Files:
-
- trunk/auto-reply/src/autoreply.cpp (modified) (1 diff)
- trunk/console/src/console.cpp (modified) (4 diffs)
- trunk/console/src/console.h (modified) (1 diff)
- trunk/licq/include/licq_color.h (modified) (2 diffs)
- trunk/licq/include/licq_events.h (modified) (20 diffs)
- trunk/licq/include/licq_icqd.h (modified) (4 diffs)
- trunk/licq/include/licq_message.h (modified) (18 diffs)
- trunk/licq/include/licq_packets.h (modified) (4 diffs)
- trunk/licq/src/icqcolor.cpp (modified) (3 diffs)
- trunk/licq/src/icqd-srv.cpp (modified) (1 diff)
- trunk/licq/src/icqd-tcp.cpp (modified) (6 diffs)
- trunk/licq/src/icqd.cpp (modified) (1 diff)
- trunk/licq/src/icqevent.cpp (modified) (3 diffs)
- trunk/licq/src/icqpacket.cpp (modified) (4 diffs)
- trunk/licq/src/message.cpp (modified) (55 diffs)
- trunk/msn/src/msn-sb.cpp (modified) (3 diffs)
- trunk/msn/src/msn-srv.cpp (modified) (8 diffs)
- trunk/msn/src/msn.h (modified) (1 diff)
- trunk/msn/src/msnpacket.cpp (modified) (3 diffs)
- trunk/msn/src/msnpacket.h (modified) (1 diff)
- trunk/osd/src/licq-osd.cpp (modified) (3 diffs)
- trunk/qt-gui/src/eventdesc.cpp (modified) (1 diff)
- trunk/qt-gui/src/eventdesc.h (modified) (1 diff)
- trunk/qt-gui/src/ewidgets.cpp (modified) (1 diff)
- trunk/qt-gui/src/ewidgets.h (modified) (1 diff)
- trunk/qt-gui/src/mainwin.cpp (modified) (1 diff)
- trunk/qt-gui/src/searchuserdlg.cpp (modified) (2 diffs)
- trunk/qt-gui/src/searchuserdlg.h (modified) (2 diffs)
- trunk/qt-gui/src/usereventdlg.cpp (modified) (2 diffs)
- trunk/qt-gui/src/usereventdlg.h (modified) (3 diffs)
- trunk/qt4-gui/src/dialogs/searchuserdlg.cpp (modified) (2 diffs)
- trunk/qt4-gui/src/dialogs/searchuserdlg.h (modified) (1 diff)
- trunk/qt4-gui/src/helpers/eventdesc.cpp (modified) (1 diff)
- trunk/qt4-gui/src/helpers/eventdesc.h (modified) (1 diff)
- trunk/qt4-gui/src/userevents/usersendchatevent.cpp (modified) (1 diff)
- trunk/qt4-gui/src/userevents/usersendcommon.cpp (modified) (6 diffs)
- trunk/qt4-gui/src/userevents/usersendfileevent.cpp (modified) (1 diff)
- trunk/qt4-gui/src/widgets/historyview.cpp (modified) (1 diff)
- trunk/qt4-gui/src/widgets/historyview.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/auto-reply/src/autoreply.cpp
r6168 r6180 212 212 void CLicqAutoReply::ProcessEvent(ICQEvent *e) 213 213 { 214 CUserEvent *user_event;214 const CUserEvent* user_event; 215 215 216 216 if (e->Result() != EVENT_ACKED) trunk/console/src/console.cpp
r6176 r6180 568 568 * CLicqConsole::AddEventTag 569 569 *-------------------------------------------------------------------------*/ 570 void CLicqConsole::AddEventTag(c har *_szId, unsigned long _nPPID, unsigned long _nEventTag)570 void CLicqConsole::AddEventTag(const char* _szId, unsigned long _nPPID, unsigned long _nEventTag) 571 571 { 572 572 if (!_szId || !_nPPID || !_nEventTag) … … 811 811 { 812 812 ICQUser *u = NULL; 813 CUserEvent *ue = e->UserEvent();813 const CUserEvent* ue = e->UserEvent(); 814 814 if (e->SubResult() == ICQ_TCPxACK_RETURN) 815 815 { … … 828 828 else if(e->SubCommand() == ICQ_CMDxSUB_FILE) 829 829 { 830 CExtendedAck *ea = e->ExtendedAck();830 const CExtendedAck* ea = e->ExtendedAck(); 831 831 832 832 if( ea == NULL || ue == NULL) … … 848 848 // For now don't check for a chat subcommand.. 849 849 // Invoke a file transfer manager here 850 CEventFile *f = (CEventFile *)ue;850 const CEventFile* f = dynamic_cast<const CEventFile *>(ue); 851 851 CFileTransferManager *ftman = new CFileTransferManager(licqDaemon, 852 852 e->Uin()); trunk/console/src/console.h
r6176 r6180 113 113 void SwitchToCon(unsigned short nCon); 114 114 void CreateUserList(); 115 void AddEventTag(char *, unsigned long, unsigned long); 115 void AddEventTag(const char* _szId, unsigned long _nPPID, 116 unsigned long _nEventTag); 116 117 117 118 void InputCommand(int cIn); trunk/licq/include/licq_color.h
r4526 r6180 9 9 CICQColor(); 10 10 11 unsigned long ForeRed() ;12 unsigned long ForeGreen() ;13 unsigned long ForeBlue() ;14 unsigned long BackRed() ;15 unsigned long BackGreen() ;16 unsigned long BackBlue() ;11 unsigned long ForeRed() const; 12 unsigned long ForeGreen() const; 13 unsigned long ForeBlue() const; 14 unsigned long BackRed() const; 15 unsigned long BackGreen() const; 16 unsigned long BackBlue() const; 17 17 18 unsigned long Foreground() ;19 unsigned long Background() ;18 unsigned long Foreground() const; 19 unsigned long Background() const; 20 20 21 21 void Set(unsigned long fore, unsigned long back); 22 void Set(CICQColor *c);22 void Set(CICQColor const* c); 23 23 void SetBackground(unsigned long r, unsigned long g, unsigned long b); 24 24 void SetForeground(unsigned long r, unsigned long g, unsigned long b); … … 36 36 static unsigned long DefaultBackground(); 37 37 38 static void SetDefaultColors(CICQColor *c);38 static void SetDefaultColors(CICQColor const* c); 39 39 static void SetDefaultForeground(unsigned long); 40 40 static void SetDefaultBackground(unsigned long); trunk/licq/include/licq_events.h
r4712 r6180 29 29 30 30 //!Returns true if the remote end accepted the request, otherwise false. 31 bool Accepted() { return m_bAccepted; }31 bool Accepted() const { return m_bAccepted; } 32 32 //!The port to connect to if the request was accpeted. 33 unsigned short Port() { return m_nPort; }33 unsigned short Port() const { return m_nPort; } 34 34 //!The reason for declining the request. 35 const char *Response(){ return m_szResponse; }35 const char* Response() const { return m_szResponse; } 36 36 37 37 ~CExtendedAck(); 38 38 39 39 protected: 40 CExtendedAck(bool , unsigned short, char *);40 CExtendedAck(bool bAccepted, unsigned short nPort, const char* szResponse); 41 41 42 42 bool m_bAccepted; … … 69 69 // Accessors 70 70 //! Returns the UIN of the search result. 71 unsigned long Uin() { return m_nUin; }71 unsigned long Uin() const { return m_nUin; } 72 72 //! Returns the alias (nickname) of the search result. 73 const char *Alias(){ return m_szAlias; }73 const char* Alias() const { return m_szAlias; } 74 74 //! Returns the first name of the search result. 75 const char *FirstName(){ return m_szFirstName; }75 const char* FirstName() const { return m_szFirstName; } 76 76 //! Returns the last name of the search result. 77 const char *LastName(){ return m_szLastName; }77 const char* LastName() const { return m_szLastName; } 78 78 //! Returns the e-mail address of the search result. 79 const char *Email(){ return m_szEmail; }79 const char* Email() const { return m_szEmail; } 80 80 //! Retunrs the Id string 81 const char *Id(){ return m_szId; }81 const char* Id() const { return m_szId; } 82 82 //! Returns the protocol plugin id 83 unsigned long PPID() { return m_nPPID; }83 unsigned long PPID() const { return m_nPPID; } 84 84 //! If non-zero, the number of search results that were found that could not 85 85 //! be displayed. The server has a 40 user limit on search results. This 86 86 //! is valid when Result() is EVENT_SUCCESS. 87 unsigned long More() { return m_nMore; }87 unsigned long More() const { return m_nMore; } 88 88 //! The online status of the search result. 89 char Status() { return m_nStatus; }89 char Status() const { return m_nStatus; } 90 90 //! The gender of the search result. Female = 1, Male = 2, Unknown = 3. 91 char Gender() { return m_nGender; }91 char Gender() const { return m_nGender; } 92 92 //! The age of the serach result. 93 char Age() { return m_nAge; }93 char Age() const { return m_nAge; } 94 94 //! Non-zero if authorization is required to add this user. 95 char Auth() { return m_nAuth; }95 char Auth() const { return m_nAuth; } 96 96 97 97 ~CSearchAck(); … … 160 160 161 161 //!This is the result of the event. 162 EventResult Result() { return m_eResult; }162 EventResult Result() const { return m_eResult; } 163 163 164 164 //!This will be either ICQ_TCPxACK_ACCEPT if the event was accepted by … … 169 169 //!field is only relevant if the command was ICQ_CMDxTCP_START (ie the 170 170 //!message was sent direct). 171 int SubResult() { return m_nSubResult; }171 int SubResult() const { return m_nSubResult; } 172 172 173 173 //!This is used to identify what channel the event was sent on. This is 174 174 //!only non-zero for server events. 175 unsigned char Channel() { return m_nChannel; }175 unsigned char Channel() const { return m_nChannel; } 176 176 177 177 //!The SNAC returned as an unsigned long. The upper 2 bytes is the family 178 178 //!and the lower 2 bytes is the subtype. To compare SNAC's use the SNAC 179 179 //!macro to convert it to an unsigned long: MAKESNAC(family, subtype). 180 unsigned long SNAC() { return m_nSNAC; }180 unsigned long SNAC() const { return m_nSNAC; } 181 181 182 182 //!The command, for example ICQ_CMDxTCP_START. This is only non-zero 183 183 //!for direct connection events. 184 unsigned short Command() { return m_nCommand; }184 unsigned short Command() const { return m_nCommand; } 185 185 186 186 //!The subcommand, relevant only if this was a message/url/chat/file, … … 188 188 //!MAKESNAC(ICQ_SNACxFAM_MESSAGE, ICQ_CMDxSND_THRU_SERVER) and this 189 189 //!field will be ICQ_CMDxSUB_MSG... 190 unsigned short SubCommand() { return m_nSubCommand; }190 unsigned short SubCommand() const { return m_nSubCommand; } 191 191 192 192 //!This is used to identify events internally, but is necessary for 193 193 //!accepting/rejecting chat or file requests. 194 unsigned short Sequence() { return m_nSequence; }194 unsigned short Sequence() const { return m_nSequence; } 195 195 196 196 //!This is used to identify events internally, is are necessary for 197 197 //!accepting/rejecting chat or file requests. 198 unsigned short SubSequence() { return m_nSubSequence; }198 unsigned short SubSequence() const { return m_nSubSequence; } 199 199 200 200 //!The uin of the user the event was destined for. Only relevant if 201 201 //!this was a message/url... 202 unsigned long Uin() { return m_nDestinationUin; }202 unsigned long Uin() const { return m_nDestinationUin; } 203 203 204 204 //!The user id that the event was destined for. Only relevant if 205 205 //!this was a message/url... 206 c har *Id(){ return m_szId; }207 206 const char* Id() const { return m_szId; } 207 208 208 //!The protocol id of the user that the event was destined for. 209 209 //!Only relevant if this was a message/url... 210 unsigned long PPID() { return m_nPPID; }210 unsigned long PPID() const { return m_nPPID; } 211 211 212 212 //!Special structure containing information relevant if this is a 213 213 //!search event. 214 CSearchAck *SearchAck(){ return m_pSearchAck; }214 const CSearchAck* SearchAck() const { return m_pSearchAck; } 215 215 216 216 //!Special structure containing information relevant if this is a 217 217 //!chat or file transfer accept or reject. 218 CExtendedAck *ExtendedAck(){ return m_pExtendedAck; }219 218 const CExtendedAck* ExtendedAck() const { return m_pExtendedAck; } 219 220 220 //!Contains the actual CUserEvent containing the message/url...that was 221 221 //!sent to Uin(). Can be used to resend the event. 222 CUserEvent *UserEvent(){ return m_pUserEvent; }222 const CUserEvent* UserEvent() const { return m_pUserEvent; } 223 223 224 224 //!If the event was a user information update (basic/extended/meta) and … … 227 227 //!to avoid having to add the user to the list before checking their 228 228 //!other information. 229 ICQUser *UnknownUser(){ return m_pUnknownUser; }229 const ICQUser* UnknownUser() const { return m_pUnknownUser; } 230 230 231 231 // Returns the event and transfers ownership to the calling function … … 245 245 ICQEvent(CICQDaemon *_xDaemon, int _nSocketDesc, CPacket *p, ConnectType _eConnect, 246 246 const char *_szId, unsigned long _nPPID, CUserEvent *e); 247 ICQEvent( ICQEvent *);247 ICQEvent(const ICQEvent* e); 248 248 249 249 // Daemon only 250 unsigned short SubType() { return m_nSubType; }251 unsigned short ExtraInfo() { return m_nExtraInfo; }250 unsigned short SubType() const { return m_nSubType; } 251 unsigned short ExtraInfo() const { return m_nExtraInfo; } 252 252 253 253 // Compare this event to another one … … 423 423 CICQSignal(unsigned long _nSignal, unsigned long _nSubSignal, const char *_szId, 424 424 unsigned long _nPPID, int nArg = 0, unsigned long nCID = 0); 425 CICQSignal( CICQSignal *s);425 CICQSignal(const CICQSignal* s); 426 426 ~CICQSignal(); 427 427 428 428 //!Returns the signal being posted to the plugin. 429 unsigned long Signal() { return m_nSignal; }429 unsigned long Signal() const { return m_nSignal; } 430 430 //!Returns the sub-signal being posted to the plugin. 431 unsigned long SubSignal() { return m_nSubSignal; }431 unsigned long SubSignal() const { return m_nSubSignal; } 432 432 //!UIN that the signal is related. See signals to understand how this 433 433 //!value is set. 434 unsigned long Uin() { return m_nUin; }435 c har *Id(){ return m_szId; }436 unsigned long PPID() { return m_nPPID; }437 int Argument() { return m_nArgument; }438 unsigned long CID() { return m_nCID; }434 unsigned long Uin() const { return m_nUin; } 435 const char* Id() const { return m_szId; } 436 unsigned long PPID() const { return m_nPPID; } 437 int Argument() const { return m_nArgument; } 438 unsigned long CID() const { return m_nCID; } 439 439 protected: 440 440 unsigned long m_nSignal; … … 520 520 521 521 //! The signal is being sent to the plugin. 522 SIGNAL_TYPE Type() { return m_eType; }522 SIGNAL_TYPE Type() const { return m_eType; } 523 523 //! The user id that this signal is being used for. 524 c har *Id(){ return m_szId; }524 const char* Id() const { return m_szId; } 525 525 //! The conversation id to use (gets the socket). 526 unsigned long CID() { return m_nCID; }526 unsigned long CID() const { return m_nCID; } 527 527 //! The calling thread. 528 pthread_t Thread() { return thread_plugin; }528 pthread_t Thread() const { return thread_plugin; } 529 529 530 530 private: … … 541 541 virtual ~CLogonSignal(); 542 542 //! The requested initial status. 543 unsigned long LogonStatus() { return m_nLogonStatus; }543 unsigned long LogonStatus() const { return m_nLogonStatus; } 544 544 545 545 private: … … 560 560 virtual ~CChangeStatusSignal(); 561 561 //! The requested status. 562 unsigned long Status() { return m_nStatus; }562 unsigned long Status() const { return m_nStatus; } 563 563 564 564 private: … … 572 572 virtual ~CAddUserSignal(); 573 573 //! True if authorization is required to add this user. 574 bool AuthRequired() { return m_bAuthRequired; }574 bool AuthRequired() const { return m_bAuthRequired; } 575 575 576 576 private: … … 604 604 virtual ~CSendMessageSignal(); 605 605 //! The message to be sent 606 c har *Message(){ return m_szMsg; }607 606 const char* Message() const { return m_szMsg; } 607 608 608 private: 609 609 char *m_szMsg; … … 615 615 CTypingNotificationSignal(const char *szId, bool bActive, unsigned long nCID = 0); 616 616 virtual ~CTypingNotificationSignal(); 617 bool Active() { return m_bActive; }617 bool Active() const { return m_bActive; } 618 618 private: 619 619 bool m_bActive; … … 625 625 CGrantAuthSignal(const char *, const char *); 626 626 virtual ~CGrantAuthSignal(); 627 c har *Message(){ return m_szMsg; }627 const char* Message() const { return m_szMsg; } 628 628 629 629 private: … … 659 659 virtual ~CUpdateInfoSignal(); 660 660 661 char *Alias(){ return m_szAlias; }662 char *FirstName(){ return m_szFirstName; }663 char *LastName(){ return m_szLastName; }664 char *Email(){ return m_szEmail; }665 char *City(){ return m_szCity; }666 char *State(){ return m_szState; }667 char *PhoneNumber(){ return m_szPhoneNumber; }668 char *FaxNumber(){ return m_szFaxNumber; }669 char *Address(){ return m_szAddress; }670 char *CellNumber(){ return m_szCellNumber; }671 char *ZipCode(){ return m_szZipCode; }672 661 const char* Alias() const { return m_szAlias; } 662 const char* FirstName() const { return m_szFirstName; } 663 const char* LastName() const { return m_szLastName; } 664 const char* Email() const { return m_szEmail; } 665 const char* City() const { return m_szCity; } 666 const char* State() const { return m_szState; } 667 const char* PhoneNumber() const { return m_szPhoneNumber; } 668 const char* FaxNumber() const { return m_szFaxNumber; } 669 const char* Address() const { return m_szAddress; } 670 const char* CellNumber() const { return m_szCellNumber; } 671 const char* ZipCode() const { return m_szZipCode; } 672 673 673 private: 674 674 char *m_szAlias, … … 734 734 virtual ~CSendFileSignal(); 735 735 736 c har *GetFileName(){ return m_szFile; }737 c har *GetMessage(){ return m_szMessage; }738 ConstFileList GetFileList() { return m_lFileList; }739 736 const char* GetFileName() const { return m_szFile; } 737 const char* GetMessage() const { return m_szMessage; } 738 ConstFileList GetFileList() const { return m_lFileList; } 739 740 740 private: 741 741 char *m_szFile, … … 750 750 virtual ~CSendChatSignal(); 751 751 752 c har *GetMessage(){ return m_szMessage; }752 const char* GetMessage() const { return m_szMessage; } 753 753 754 754 private: … … 762 762 virtual ~CCancelEventSignal(); 763 763 764 unsigned long GetFlag() { return m_nFlag; }764 unsigned long GetFlag() const { return m_nFlag; } 765 765 766 766 private: … … 778 778 virtual ~CSendEventReplySignal(); 779 779 780 c har *GetMessage(){ return m_szMessage; }781 bool GetAccept() { return m_bAccept; }782 bool GetDirect() { return m_bDirect; }783 unsigned short GetPort() { return m_nPort; }784 unsigned long GetSequence() { return m_nSequence; }785 unsigned long GetFlag() { return m_nFlag; }786 unsigned long GetFlag2() { return m_nFlag2; }787 780 const char* GetMessage() const { return m_szMessage; } 781 bool GetAccept() const { return m_bAccept; } 782 bool GetDirect() const { return m_bDirect; } 783 unsigned short GetPort() const { return m_nPort; } 784 unsigned long GetSequence() const { return m_nSequence; } 785 unsigned long GetFlag() const { return m_nFlag; } 786 unsigned long GetFlag2() const { return m_nFlag2; } 787 788 788 private: 789 789 char *m_szMessage; trunk/licq/include/licq_icqd.h
r6104 r6180 266 266 unsigned short nLevel, bool bServer); 267 267 void ProtoChatRequestRefuse(const char *szId, unsigned long nPPID, 268 const char *szReason, unsigned short nSequence, unsigned long nMsgID[],269 bool bDirect);268 const char* szReason, unsigned short nSequence, 269 const unsigned long nMsgID[], bool bDirect); 270 270 void ProtoChatRequestAccept(const char *szId, unsigned long nPPID, 271 unsigned short nPort, const char *szClients, unsigned long nSequeunce,272 unsigned long nMsgID[], bool bDirect);271 unsigned short nPort, const char* szClients, unsigned long nSequeunce, 272 const unsigned long nMsgID[], bool bDirect); 273 273 void ProtoChatRequestCancel(const char *szId, unsigned long nPPID, 274 274 unsigned short nSequence); … … 337 337 unsigned short nLevel, bool bServer); 338 338 void icqChatRequestRefuse(unsigned long nUin, const char *szReason, 339 unsigned short nSequence,unsigned long nMsgID[], bool bDirect);339 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect); 340 340 void icqChatRequestAccept(unsigned long nUin, unsigned short nPort, 341 const char *szClients, unsigned short nSequence, unsigned long nMsgID[], bool bDirect); 341 const char* szClients, unsigned short nSequence, 342 const unsigned long nMsgID[], bool bDirect); 342 343 void icqChatRequestCancel(unsigned long nUin, unsigned short nSequence); 343 344 // File Transfer … … 349 350 unsigned short nLevel, bool bServer); 350 351 void icqFileTransferRefuse(const char *szId, const char *szReason, 351 unsigned short nSequence, unsigned long nMsgID[], bool bDirect);352 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect); 352 353 void icqFileTransferRefuse(unsigned long nUin, const char *szReason, 353 unsigned short nSequence,unsigned long nMsgID[], bool bDirect);354 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect); 354 355 void icqFileTransferCancel(const char *szId, unsigned short nSequence); 355 356 void icqFileTransferCancel(unsigned long nUin, unsigned short nSequence); 356 357 void icqFileTransferAccept(const char *szId, unsigned short nPort, 357 unsigned short nSequence, unsigned long nMsgID[], bool bDirect,358 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect, 358 359 const char *szDesc, const char *szFile, unsigned long nFileSize); 359 360 void icqFileTransferAccept(unsigned long nUin, unsigned short nPort, 360 unsigned short nSequence, unsigned long nMsgID[], bool bDirect,361 unsigned short nSequence, const unsigned long nMsgID[], bool bDirect, 361 362 const char *szDesc, const char *szFile, unsigned long nFileSize); 362 363 unsigned long icqOpenSecureChannel(const char *szId); … … 643 644 void ProcessMessage(ICQUser *user, CBuffer &packet, char *message, 644 645 unsigned short nMsgType, unsigned long nMask, 645 unsigned long nMsgID[], unsigned short nSequence,646 const unsigned long nMsgID[], unsigned short nSequence, 646 647 bool bIsAck, bool &bNewUser); 647 648 trunk/licq/include/licq_message.h
r4904 r6180 38 38 virtual ~CUserEvent(); 39 39 40 virtual CUserEvent *Copy()= 0;41 const char *Text();42 const char *Description();43 time_t Time() {return m_tTime; }44 const char *LicqVersionStr();40 virtual CUserEvent* Copy() const = 0; 41 const char* Text() const; 42 const char* Description() const; 43 time_t Time() const { return m_tTime; } 44 const char* LicqVersionStr() const; 45 45 static const char *LicqVersionToString(unsigned long); 46 unsigned short Sequence(){ return m_nSequence; }47 unsigned short Command(){ return m_nCommand; }48 unsigned short SubCommand(){ return m_nSubCommand; }49 int Id(){ return m_nId; }50 bool IsDirect(){ return m_nFlags & E_DIRECT; }51 bool IsMultiRec(){ return m_nFlags & E_MULTIxREC; }52 bool IsUrgent(){ return m_nFlags & E_URGENT; }53 bool IsCancelled(){ return m_nFlags & E_CANCELLED; }54 bool IsLicq(){ return LicqVersion() != 0; };55 bool IsEncrypted(){ return m_nFlags & E_ENCRYPTED; };56 unsigned short LicqVersion(){ return m_nFlags & E_LICQxVER; }57 direction Direction() {return m_eDir; }58 CICQColor *Color(){ return &m_sColor; }59 unsigned long ConvoId(){ return m_nConvoId; }60 61 bool Pending(){ return m_bPending; }46 unsigned short Sequence() const { return m_nSequence; } 47 unsigned short Command() const { return m_nCommand; } 48 unsigned short SubCommand() const { return m_nSubCommand; } 49 int Id() const { return m_nId; } 50 bool IsDirect() const { return m_nFlags & E_DIRECT; } 51 bool IsMultiRec() const { return m_nFlags & E_MULTIxREC; } 52 bool IsUrgent() const { return m_nFlags & E_URGENT; } 53 bool IsCancelled() const { return m_nFlags & E_CANCELLED; } 54 bool IsLicq() const { return LicqVersion() != 0; }; 55 bool IsEncrypted() const { return m_nFlags & E_ENCRYPTED; }; 56 unsigned short LicqVersion() const { return m_nFlags & E_LICQxVER; } 57 direction Direction() const { return m_eDir; } 58 const CICQColor* Color() const { return &m_sColor; } 59 unsigned long ConvoId() const { return m_nConvoId; } 60 61 bool Pending() const { return m_bPending; } 62 62 void SetPending(bool b) { m_bPending = b; } 63 63 64 64 protected: 65 virtual void AddToHistory(ICQUser *, unsigned long, direction)= 0;66 int AddToHistory_Header(direction, char *);67 void AddToHistory_Flush(ICQUser *, unsigned long, char *);65 virtual void AddToHistory(ICQUser* user, unsigned long ppid, direction dir) const = 0; 66 int AddToHistory_Header(direction _nDir, char* szOut) const; 67 void AddToHistory_Flush(ICQUser* u, unsigned long nPPID, const char* szOut) const; 68 68 69 69 void SetDirection(direction d) { m_eDir = d; } 70 70 void Cancel() { m_nFlags |= E_CANCELLED; } 71 71 void SetColor(unsigned long fore, unsigned long back) { m_sColor.Set(fore, back); } 72 void SetColor(CICQColor *p) { m_sColor.Set(p); } 73 74 void CopyBase(CUserEvent *); 75 76 virtual void CreateDescription() = 0; 72 void SetColor(CICQColor const* p) { m_sColor.Set(p); } 73 74 void CopyBase(const CUserEvent* e); 75 76 // CreateDescription() is const even though it changes m_szText since 77 // it may be called to perform delayed initialization in const context. 78 virtual void CreateDescription() const = 0; 77 79 static int s_nId; 78 80 79 char *m_szText; 81 // m_szText is not initialized until it is accessed. Allow this delayed 82 // initialization even if called in const context. 83 mutable char* m_szText; 80 84 unsigned short m_nCommand; 81 85 unsigned short m_nSubCommand; … … 105 109 virtual ~CEventMsg(); 106 110 107 virtual CEventMsg *Copy();108 const char *Message(){ return m_szMessage; }109 virtual void AddToHistory(ICQUser *, unsigned long, direction);111 virtual CEventMsg* Copy() const; 112 const char* Message() const { return m_szMessage; } 113 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 110 114 111 115 static CEventMsg *Parse(char *sz, unsigned short nCmd, time_t nTime, 112 116 unsigned long nFlags, unsigned long nConvoId = 0); 113 117 protected: 114 void CreateDescription();118 void CreateDescription() const; 115 119 char *m_szMessage; 116 120 }; … … 122 126 public: 123 127 CEventFile(const char *_szFilename, const char *_szFileDescription, 124 unsigned long _nFileSize, ConstFileList &lFileList,128 unsigned long _nFileSize, const ConstFileList& lFileList, 125 129 unsigned short _nSequence, time_t _tTime, 126 130 unsigned long _nFlags, unsigned long _nConovId = 0, 127 131 unsigned long _nMsgID1 = 0, unsigned long _nMsgID2 = 0); 128 132 virtual ~CEventFile(); 129 virtual CEventFile *Copy();130 virtual void AddToHistory(ICQUser *, unsigned long, direction);131 132 const char *Filename(){ return m_szFilename; }133 unsigned long FileSize(){ return m_nFileSize; }134 const char *FileDescription(){ return m_szFileDescription; }135 ConstFileList FileList(){ return m_lFileList; }136 unsigned long *MessageID(){ return m_nMsgID; }137 protected: 138 void CreateDescription();133 virtual CEventFile* Copy() const; 134 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 135 136 const char* Filename() const { return m_szFilename; } 137 unsigned long FileSize() const { return m_nFileSize; } 138 const char* FileDescription() const { return m_szFileDescription; } 139 ConstFileList FileList() const { return m_lFileList; } 140 const unsigned long* MessageID() const { return m_nMsgID; } 141 protected: 142 void CreateDescription() const; 139 143 char *m_szFilename; 140 144 char *m_szFileDescription; … … 153 157 unsigned long _nFlags, unsigned long _nConvoId = 0); 154 158 virtual ~CEventUrl(); 155 virtual CEventUrl *Copy();156 virtual void AddToHistory(ICQUser *, unsigned long, direction);157 const char *Url(){ return m_szUrl; }158 const char *Description(){ return m_szUrlDescription; }159 virtual CEventUrl* Copy() const; 160 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 161 const char* Url() const { return m_szUrl; } 162 const char* Description() const { return m_szUrlDescription; } 159 163 160 164 static CEventUrl *Parse(char *sz, unsigned short nCmd, time_t nTime, 161 165 unsigned long nFlags, unsigned long nConvoId = 0); 162 166 protected: 163 void CreateDescription();167 void CreateDescription() const; 164 168 char *m_szUrl; 165 169 char *m_szUrlDescription; … … 178 182 unsigned long _nConvoId = 0, unsigned long nMsgID1 = 0, unsigned long nMsgID2 = 0); 179 183 virtual ~CEventChat(); 180 virtual CEventChat *Copy();181 virtual void AddToHistory(ICQUser *, unsigned long, direction);182 const char *Reason(){ return m_szReason; }183 const char *Clients(){ return m_szClients; }184 unsigned short Port() { return m_nPort; }185 unsigned long *MessageID(){ return m_nMsgID; }186 protected: 187 void CreateDescription() ;184 virtual CEventChat* Copy() const; 185 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 186 const char* Reason() const { return m_szReason; } 187 const char* Clients() const { return m_szClients; } 188 unsigned short Port() const { return m_nPort; } 189 const unsigned long* MessageID() const { return m_nMsgID; } 190 protected: 191 void CreateDescription() const; 188 192 char *m_szReason; 189 193 char *m_szClients; … … 204 208 unsigned short _nCommand, time_t _tTime, unsigned long _nFlags); 205 209 virtual ~CEventAdded(); 206 virtual CEventAdded *Copy();207 virtual void AddToHistory(ICQUser *, unsigned long, direction);208 unsigned long Uin(){ return m_nUin; };209 char *IdString(){ return m_szId; }210 unsigned long PPID(){ return m_nPPID; }211 protected: 212 void CreateDescription();210 virtual CEventAdded* Copy() const; 211 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 212 unsigned long Uin() const { return m_nUin; }; 213 const char* IdString() const { return m_szId; } 214 unsigned long PPID() const { return m_nPPID; } 215 protected: 216 void CreateDescription() const; 213 217 unsigned long m_nUin; 214 218 char *m_szId; … … 234 238 unsigned short _nCommand, time_t _tTime, unsigned long _nFlags); 235 239 virtual ~CEventAuthRequest(); 236 virtual CEventAuthRequest *Copy();237 virtual void AddToHistory(ICQUser *, unsigned long, direction);238 unsigned long Uin(){ return m_nUin; };239 char *IdString(){ return m_szId; }240 unsigned long PPID(){ return m_nPPID; }241 protected: 242 void CreateDescription();240 virtual CEventAuthRequest* Copy() const; 241 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 242 unsigned long Uin() const { return m_nUin; }; 243 const char* IdString() const { return m_szId; } 244 unsigned long PPID() const { return m_nPPID; } 245 protected: 246 void CreateDescription() const; 243 247 unsigned long m_nUin; 244 248 char *m_szId; … … 261 265 unsigned short _nCommand, time_t _tTime, unsigned long _nFlags); 262 266 virtual ~CEventAuthGranted(); 263 virtual CEventAuthGranted *Copy();264 virtual void AddToHistory(ICQUser *, unsigned long, direction);265 unsigned long Uin(){ return m_nUin; };266 char *IdString(){ return m_szId; }267 unsigned long PPID(){ return m_nPPID; }268 protected: 269 void CreateDescription();267 virtual CEventAuthGranted* Copy() const; 268 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 269 unsigned long Uin() const { return m_nUin; }; 270 const char* IdString() const { return m_szId; } 271 unsigned long PPID() const { return m_nPPID; } 272 protected: 273 void CreateDescription() const; 270 274 unsigned long m_nUin; 271 275 char *m_szId; … … 284 288 unsigned short _nCommand, time_t _tTime, unsigned long _nFlags); 285 289 virtual ~CEventAuthRefused(); 286 virtual CEventAuthRefused *Copy();287 virtual void AddToHistory(ICQUser *, unsigned long, direction);288 unsigned long Uin(){ return m_nUin; };289 char *IdString(){ return m_szId; }290 unsigned long PPID(){ return m_nPPID; }291 protected: 292 void CreateDescription();290 virtual CEventAuthRefused* Copy() const; 291 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 292 unsigned long Uin() const { return m_nUin; }; 293 const char* IdString() const { return m_szId; } 294 unsigned long PPID() const { return m_nPPID; } 295 protected: 296 void CreateDescription() const; 293 297 unsigned long m_nUin; 294 298 char *m_szId; … … 305 309 unsigned short _nCommand, time_t _tTime, unsigned long _nFlags); 306 310 virtual ~CEventWebPanel(); 307 virtual CEventWebPanel *Copy();308 virtual void AddToHistory(ICQUser *, unsigned long, direction);309 protected: 310 void CreateDescription();311 virtual CEventWebPanel* Copy() const; 312 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 313 protected: 314 void CreateDescription() const; 311 315 char *m_szName; 312 316 char *m_szEmail; … … 322 326 unsigned short _nCommand, time_t _tTime, unsigned long _nFlags); 323 327 virtual ~CEventEmailPager(); 324 virtual CEventEmailPager *Copy();325 virtual void AddToHistory(ICQUser *, unsigned long, direction);326 protected: 327 void CreateDescription();328 virtual CEventEmailPager* Copy() const; 329 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 330 protected: 331 void CreateDescription() const; 328 332 char *m_szName; 329 333 char *m_szEmail; … … 340 344 ~CContact(); 341 345 342 unsigned long Uin() { return m_nUin; }343 const char *Alias(){ return m_szAlias; }344 c har *IdString(){ return m_szId; }345 unsigned long PPID() { return m_nPPID; }346 unsigned long Uin() const { return m_nUin; } 347 const char* Alias() const { return m_szAlias; } 348 const char* IdString() const { return m_szId; } 349 unsigned long PPID() const { return m_nPPID; } 346 350 protected: 347 351 unsigned long m_nUin; … … 356 360 { 357 361 public: 358 CEventContactList( ContactList &cl, bool bDeep, unsigned short nCommand,362 CEventContactList(const ContactList& cl, bool bDeep, unsigned short nCommand, 359 363 time_t tTime, unsigned long nFlags); 360 364 virtual ~CEventContactList(); 361 virtual CEventContactList *Copy();362 virtual void AddToHistory(ICQUser *, unsigned long, direction);363 364 const ContactList &Contacts() { return m_vszFields; }365 virtual CEventContactList* Copy() const; 366 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 367 368 const ContactList &Contacts() const { return m_vszFields; } 365 369 366 370 static CEventContactList *Parse(char *sz, unsigned short nCmd, time_t nTime, unsigned long nFlags); 367 371 protected: 368 void CreateDescription() ;372 void CreateDescription() const; 369 373 ContactList m_vszFields; 370 374 }; … … 378 382 unsigned short _nCommand, time_t _tTime, unsigned long _nFlags); 379 383 virtual ~CEventSms(); 380 virtual CEventSms *Copy();381 const char *Number(){ return m_szNumber; }382 const char *Message(){ return m_szMessage; }383 virtual void AddToHistory(ICQUser *, unsigned long, direction);384 virtual CEventSms* Copy() const; 385 const char* Number() const { return m_szNumber; } 386 const char* Message() const { return m_szMessage; } 387 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 384 388 385 389 static CEventSms *Parse(char *sz, unsigned short nCmd, time_t nTime, unsigned long nFlags); 386 390 protected: 387 void CreateDescription();391 void CreateDescription() const; 388 392 char *m_szNumber; 389 393 char *m_szMessage; … … 397 401 const char *_szMessage, time_t _tTime); 398 402 virtual ~CEventServerMessage(); 399 virtual CEventServerMessage *Copy();400 virtual void AddToHistory(ICQUser *, unsigned long, direction);403 virtual CEventServerMessage* Copy() const; 404 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 401 405 402 406 static CEventServerMessage *Parse(char *, unsigned short, time_t, unsigned long); 403 407 404 408 protected: 405 void CreateDescription();409 void CreateDescription() const; 406 410 407 411 char *m_szName, … … 421 425 const char *_szCreds = 0, unsigned long _nSessionLength = 0); 422 426 virtual ~CEventEmailAlert(); 423 virtual CEventEmailAlert *Copy();424 virtual void AddToHistory(ICQUser *, unsigned long, direction);425 426 c har *From(){ return m_szName; }427 c har *To(){ return m_szTo; }428 c har *Email(){ return m_szEmail; }429 c har *Subject(){ return m_szSubject; }430 431 c har *MSPAuth(){ return m_szMSPAuth; }432 c har *SID(){ return m_szSID; }433 c har *KV(){ return m_szKV; }434 c har *Id(){ return m_szId; }435 c har *PostURL(){ return m_szPostURL; }436 c har *MsgURL(){ return m_szMsgURL; }437 c har *Creds(){ return m_szCreds; }438 unsigned long SessionLength() { return m_nSessionLength; }439 440 protected: 441 void CreateDescription() ;427 virtual CEventEmailAlert* Copy() const; 428 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 429 430 const char* From() const { return m_szName; } 431 const char* To() const { return m_szTo; } 432 const char* Email() const { return m_szEmail; } 433 const char* Subject() const { return m_szSubject; } 434 435 const char* MSPAuth() const { return m_szMSPAuth; } 436 const char* SID() const { return m_szSID; } 437 const char* KV() const { return m_szKV; } 438 const char* Id() const { return m_szId; } 439 const char* PostURL() const { return m_szPostURL; } 440 const char* MsgURL() const { return m_szMsgURL; } 441 const char* Creds() const { return m_szCreds; } 442 unsigned long SessionLength() const { return m_nSessionLength; } 443 444 protected: 445 void CreateDescription() const; 442 446 443 447 // Info … … 464 468 time_t tTime, unsigned long nFlags); 465 469 ~CEventPlugin(); 466 virtual CEventPlugin *Copy();467 virtual void AddToHistory(ICQUser *, unsigned long, direction);468 protected: 469 void CreateDescription() ;470 virtual CEventPlugin* Copy() const; 471 virtual void AddToHistory(ICQUser* user, unsigned long ppid, direction dir) const; 472 protected: 473 void CreateDescription() const; 470 474 char *m_sz; 471 475 }; … … 487 491 time_t _tTime, unsigned long _nFlags); 488 492 ~CEventUnknownSysMsg(); 489 virtual CEventUnknownSysMsg *Copy();490 virtual void AddToHistory(ICQUser *, unsigned long, direction);491 protected: 492 void CreateDescription();493 virtual CEventUnknownSysMsg* Copy() const; 494 virtual void AddToHistory(ICQUser* u, unsigned long _nPPID, direction _nDir) const; 495 protected: 496 void CreateDescription() const; 493 497 unsigned long m_nUin; 494 498 char *m_szMsg; trunk/licq/include/licq_packets.h
