Changeset 6462 for trunk/licq

Show
Ignore:
Timestamp:
07/24/08 04:07:24 (4 months ago)
Author:
flynd
Message:

Declare get functions in user object as const so we can use const pointers for the users.

Location:
trunk/licq
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/licq/include/licq_history.h

    r6177 r6462  
    1717  void SetFile(const char *, const char *, unsigned long); 
    1818  void Append(const char* buf) { Write(buf, true); } 
    19   bool Load(HistoryList &); 
     19  bool Load(HistoryList& history) const; 
    2020  static void Clear(HistoryList &); 
    2121  void Save(const char* buf) { Write(buf, false); } 
    22   const char *Description()  { return m_szDescription; } 
    23   const char *FileName()     { return m_szFileName; } 
     22  const char* Description() const       { return m_szDescription; } 
     23  const char* FileName() const          { return m_szFileName; } 
    2424 
    2525  /** 
  • trunk/licq/include/licq_user.h

    r6459 r6462  
    331331 
    332332  bool Get(unsigned d,unsigned short *id, char const ** descr) const; 
    333   UserCat GetCategory() { return m_uc; } 
     333  UserCat GetCategory() const                   { return m_uc; } 
    334334 
    335335  static const unsigned MAX_CATEGORIES = 4; 
     
    409409  void SetActive(long nEntry); 
    410410 
    411   bool Get(unsigned long nEntry, const struct PhoneBookEntry  **entry); 
     411  bool Get(unsigned long nEntry, const struct PhoneBookEntry** entry) const; 
    412412 
    413413private: 
     
    451451  // General Info 
    452452  //!Retrieves the user's alias. 
    453   char *GetAlias()                      {  return m_szAlias; } 
     453  const char* GetAlias() const                  { return m_szAlias; } 
    454454  //!Retrieves the user's first name. 
    455   char *GetFirstName()                  {  return m_szFirstName; } 
     455  const char* GetFirstName() const              { return m_szFirstName; } 
    456456  //!Retrieves the user's last name. 
    457   char *GetLastName()                   {  return m_szLastName; } 
     457  const char* GetLastName() const               { return m_szLastName; } 
    458458  //!Retrieves the user's primary e-mail address. 
    459   char *GetEmailPrimary()               {  return m_szEmailPrimary; } 
     459  const char* GetEmailPrimary() const           { return m_szEmailPrimary; } 
    460460  //!Retrieves the user's secondary e-mail address. 
    461   char *GetEmailSecondary()             {  return m_szEmailSecondary; } 
     461  const char* GetEmailSecondary() const         { return m_szEmailSecondary; } 
    462462  //!Retrieves the user's old e-mail address. 
    463   char *GetEmailOld()                   {  return m_szEmailOld; } 
     463  const char* GetEmailOld() const               { return m_szEmailOld; } 
    464464  //!Retrieves the user's city. 
    465   char *GetCity()                       {  return m_szCity; } 
     465  const char* GetCity() const                   { return m_szCity; } 
    466466  //!Retrieves the user's state. 
    467   char *GetState()                      {  return m_szState; } 
     467  const char* GetState() const                  { return m_szState; } 
    468468  //!Retrieves the user's phone number. 
    469   char *GetPhoneNumber()                {  return m_szPhoneNumber; } 
     469  const char* GetPhoneNumber() const            { return m_szPhoneNumber; } 
    470470  //!Retrieves the user's fax number. 
    471   char *GetFaxNumber()                  {  return m_szFaxNumber; } 
     471  const char* GetFaxNumber() const              { return m_szFaxNumber; } 
    472472  //!Retrieves the user's street address. 
    473   char *GetAddress()                    {  return m_szAddress; } 
     473  const char* GetAddress() const                { return m_szAddress; } 
    474474  //!Retrieves the user's cellular phone number. 
    475   char *GetCellularNumber()             {  return m_szCellularNumber; } 
     475  const char* GetCellularNumber() const         { return m_szCellularNumber; } 
    476476  //!Retrieves the user's zip code. 
    477   char *GetZipCode()                    {  return m_szZipCode; } 
     477  const char* GetZipCode() const                { return m_szZipCode; } 
    478478  //!Retrieves the user's country code.  Used to lookup the country name. 
    479   unsigned short GetCountryCode()       {  return m_nCountryCode; } 
     479  unsigned short GetCountryCode() const         { return m_nCountryCode; } 
    480480  //!Retrieves the user's time code. 
    481   char GetTimezone()                    {  return m_nTimezone; } 
     481  char GetTimezone() const                      { return m_nTimezone; } 
    482482  //!Returns true if the user requires you to be authorized to add 
    483483  //!them to anyone's ICQ list. 
    484   bool GetAuthorization()               {  return m_bAuthorization; } 
     484  bool GetAuthorization() const                 { return m_bAuthorization; } 
    485485  //!Retrieves the users's web status 
    486   unsigned char GetWebAwareStatus()     { return m_nWebAwareStatus; } 
     486  unsigned char GetWebAwareStatus() const       { return m_nWebAwareStatus; } 
    487487  //!Returns true if the user has attempted to hide the e-mail addresses 
    488488  //!provided in their information. 
    489   bool GetHideEmail()                   {  return m_bHideEmail; } 
     489  bool GetHideEmail() const                     { return m_bHideEmail; } 
    490490 
    491491  // More Info 
    492492  //!Retrieves the user's age. 
    493   unsigned short GetAge()               {  return m_nAge; } 
     493  unsigned short GetAge() const                 { return m_nAge; } 
    494494  //!Retrieves the user's gender. 
    495   char GetGender()                      {  return m_nGender; } 
     495  char GetGender() const                        {  return m_nGender; } 
    496496  //!Retrieves the user's homepage URL. 
    497   char *GetHomepage()                   {  return m_szHomepage; } 
     497  const char* GetHomepage() const               {  return m_szHomepage; } 
    498498  //!Retrieves the user's year they were born ih. 
    499   unsigned short GetBirthYear()         {  return m_nBirthYear; } 
     499  unsigned short GetBirthYear() const           {  return m_nBirthYear; } 
    500500  //!Retrieves the user's month they were born in. 
    501   char GetBirthMonth()                  {  return m_nBirthMonth; } 
     501  char GetBirthMonth() const                    {  return m_nBirthMonth; } 
    502502  //!Retrieves the user's day they were born in. 
    503   char GetBirthDay()                    {  return m_nBirthDay; } 
     503  char GetBirthDay() const                      {  return m_nBirthDay; } 
    504504  //!Retrieves the user's first language. 
    505   char GetLanguage1()                   {  return m_nLanguage[0]; } 
     505  char GetLanguage1() const                     {  return m_nLanguage[0]; } 
    506506  //!Retrieves the user's second language. 
    507   char GetLanguage2()                   {  return m_nLanguage[1]; } 
     507  char GetLanguage2() const                     {  return m_nLanguage[1]; } 
    508508  //!Retrieves the user's third language. 
    509   char GetLanguage3()                   {  return m_nLanguage[2]; } 
     509  char GetLanguage3() const                     {  return m_nLanguage[2]; } 
    510510  //!Retrieves the user's language as specified by the parameter. 
    511511  //!Useful when retrieving their languages in a loop. 
    512   char GetLanguage(unsigned char l)        {  return m_nLanguage[l]; } 
     512  char GetLanguage(unsigned char l) const       {  return m_nLanguage[l]; } 
    513513 
    514514  // Homepage Info 
    515515  //!Returns true if the user has entered a homepage category 
    516   bool GetHomepageCatPresent()             {  return m_bHomepageCatPresent; } 
     516  bool GetHomepageCatPresent() const            {  return m_bHomepageCatPresent; } 
    517517  //!Retrieves the user's homepage category code 
    518   unsigned short GetHomepageCatCode()      {  return m_nHomepageCatCode; } 
     518  unsigned short GetHomepageCatCode() const     {  return m_nHomepageCatCode; } 
    519519  //!Retrivies the users homepage description 
    520   char *GetHomepageDesc()               {  return m_szHomepageDesc; } 
    521   //!Returns true if the user has an ICQ homepage (http://<uin>.home.icq.com/) 
    522   bool GetICQHomepagePresent()          {  return m_bICQHomepagePresent; } 
     520  const char* GetHomepageDesc() const           {  return m_szHomepageDesc; } 
     521  //!Returns true if the user has an ICQ homepage (http://<uin>.home.icq.com/) const 
     522  bool GetICQHomepagePresent() const            {  return m_bICQHomepagePresent; } 
    523523 
    524524  // Work Info 
    525525  //!Retrieves the city of the company the user is employed by. 
    526   char *GetCompanyCity()                {  return m_szCompanyCity; } 
     526  const char* GetCompanyCity() const            {  return m_szCompanyCity; } 
    527527  //!Retrieves the state of the company the user is employed by. 
    528   char *GetCompanyState()               {  return m_szCompanyState; } 
     528  const char* GetCompanyState() const           {  return m_szCompanyState; } 
    529529  //!Retrieves the phone number of the company's phone number the user is employed by. 
    530   char *GetCompanyPhoneNumber()         {  return m_szCompanyPhoneNumber; } 
     530  const char* GetCompanyPhoneNumber() const     {  return m_szCompanyPhoneNumber; } 
    531531  //!Retrieves the fax bynber of the company the user is employed by. 
    532   char *GetCompanyFaxNumber()           {  return m_szCompanyFaxNumber; } 
     532  const char* GetCompanyFaxNumber() const       {  return m_szCompanyFaxNumber; } 
    533533  //!Retrieves the street address of the company the user is employed by. 
    534   char *GetCompanyAddress()             {  return m_szCompanyAddress; } 
     534  const char* GetCompanyAddress() const         {  return m_szCompanyAddress; } 
    535535  //!Retrieves the zip code of the company the user is employed by. 
    536   char *GetCompanyZip()         {  return m_szCompanyZip; } 
     536  const char* GetCompanyZip() const             { return m_szCompanyZip; } 
    537537  //!Retrieves the country code of the company the user is employed by. 
    538538  //!Used to look up the country name. 
    539   unsigned short GetCompanyCountry()    {  return m_nCompanyCountry; } 
     539  unsigned short GetCompanyCountry() const      {  return m_nCompanyCountry; } 
    540540  //!Retrieves the name of the company the user is employed by. 
    541   char *GetCompanyName()                {  return m_szCompanyName; } 
     541  const char* GetCompanyName() const            {  return m_szCompanyName; } 
    542542  //!Retrieves the department the user is in. 
    543   char *GetCompanyDepartment()          {  return m_szCompanyDepartment; } 
     543  const char* GetCompanyDepartment() const      {  return m_szCompanyDepartment; } 
    544544  //!Retrieves the user's job title. 
    545   char *GetCompanyPosition()            {  return m_szCompanyPosition; } 
     545  const char* GetCompanyPosition() const        {  return m_szCompanyPosition; } 
    546546  //!Retrieves the users's occupation code 
    547   unsigned short GetCompanyOccupation() {  return m_nCompanyOccupation; } 
     547  unsigned short GetCompanyOccupation() const   {  return m_nCompanyOccupation; } 
    548548  //!Retrieves the URL of the company the user is employed by. 
    549   char *GetCompanyHomepage()            {  return m_szCompanyHomepage; } 
     549  const char* GetCompanyHomepage() const        {  return m_szCompanyHomepage; } 
    550550 
    551551  // About Info 
    552552  //!Retrieves the self description of the user. 
    553   char *GetAbout()                      { return m_szAbout; } 
     553  const char* GetAbout() const                  { return m_szAbout; } 
    554554 
    555555  // More2 Info 
    556556  //!Retrieves the user's interests 
    557557  ICQUserCategory *GetInterests()       { return m_Interests; } 
     558  const ICQUserCategory* GetInterests() const   { return m_Interests; } 
    558559  //!Retrieves the user's backgrounds 
    559560  ICQUserCategory *GetBackgrounds()     { return m_Backgrounds; } 
     561  const ICQUserCategory* GetBackgrounds() const { return m_Backgrounds; } 
    560562  //!Retrieves the user's organizations 
    561563  ICQUserCategory *GetOrganizations()   { return m_Organizations; } 
     564  const ICQUserCategory* GetOrganizations() const { return m_Organizations; } 
    562565 
    563566  // Phone Book Info 
    564567  //!Retrives the user's phone book 
    565568  ICQUserPhoneBook *GetPhoneBook()      { return m_PhoneBook; } 
     569  const ICQUserPhoneBook* GetPhoneBook() const  { return m_PhoneBook; } 
    566570 
    567571  // Picture Info 
    568   bool GetPicturePresent()              { return m_bPicturePresent; } 
     572  bool GetPicturePresent() const              { return m_bPicturePresent; } 
    569573  unsigned short BuddyIconType()    { return m_nBuddyIconType; } 
    570574  char BuddyIconHashType()      { return m_nBuddyIconHashType; } 
     
    576580 
    577581  // Licq Info 
    578   bool GetAwaitingAuth()                { return m_bAwaitingAuth; } 
    579   unsigned short GetSID()               { return m_nSID[NORMAL_SID]; } 
    580   unsigned short GetInvisibleSID()      { return m_nSID[INV_SID]; } 
    581   unsigned short GetVisibleSID()        { return m_nSID[VIS_SID]; } 
    582   unsigned short GetGSID()              { return m_nGSID; } 
    583   unsigned short GetTyping()            { return m_nTyping; } 
     582  bool GetAwaitingAuth() const                  { return m_bAwaitingAuth; } 
     583  unsigned short GetSID() const                 { return m_nSID[NORMAL_SID]; } 
     584  unsigned short GetInvisibleSID() const        { return m_nSID[INV_SID]; } 
     585  unsigned short GetVisibleSID() const          { return m_nSID[VIS_SID]; } 
     586  unsigned short GetGSID() const                { return m_nGSID; } 
     587  unsigned short GetTyping() const              { return m_nTyping; } 
    584588  //!Retrieves the user's auto response message that was last seen. 
    585   char *AutoResponse()                  { return m_szAutoResponse; } 
     589  const char* AutoResponse() const              { return m_szAutoResponse; } 
    586590  //!Retrieves the encoding Licq uses for this user 
    587   char* UserEncoding(); 
     591  const char* UserEncoding() const; 
    588592  //!True if they have sent the UTF8 Cap 
    589   bool SupportsUTF8()                   { return m_bSupportsUTF8; } 
    590   bool SendServer()                     { return m_bSendServer; } 
    591   unsigned short SendLevel()            { return m_nSendLevel; } 
    592   bool EnableSave()                     { return m_bEnableSave; } 
    593   bool ShowAwayMsg()                    { return m_bShowAwayMsg; } 
     593  bool SupportsUTF8() const                     { return m_bSupportsUTF8; } 
     594  bool SendServer() const                       { return m_bSendServer; } 
     595  unsigned short SendLevel() const              { return m_nSendLevel; } 
     596  bool EnableSave() const                       { return m_bEnableSave; } 
     597  bool ShowAwayMsg() const                      { return m_bShowAwayMsg; } 
    594598  unsigned short Sequence(bool = false); 
    595   char Mode()                           { return m_nMode; } 
    596   unsigned long Version()               { return m_nVersion; } 
    597   char *ClientInfo()                    { return m_szClientInfo; } 
    598   unsigned long ClientTimestamp()       { return m_nClientTimestamp; } 
    599   unsigned long OurClientTimestamp()    { return m_nOurClientTimestamp; } 
    600   unsigned long ClientInfoTimestamp()   { return m_nClientInfoTimestamp; } 
    601   unsigned long OurClientInfoTimestamp() { return m_nOurClientInfoTimestamp; } 
    602   unsigned long ClientStatusTimestamp() { return m_nClientStatusTimestamp; } 
    603   unsigned long OurClientStatusTimestamp() { return m_nOurClientStatusTimestamp; } 
    604   bool UserUpdated()                    { return m_bUserUpdated; } 
    605   SecureChannelSupport_et SecureChannelSupport(); 
    606   unsigned short LicqVersion(); 
    607   unsigned short ConnectionVersion(); 
    608   time_t LastOnline()                   { return m_nLastCounters[LAST_ONLINE]; } 
    609   time_t LastSentEvent()                { return m_nLastCounters[LAST_SENT_EVENT]; } 
    610   time_t LastReceivedEvent()            { return m_nLastCounters[LAST_RECV_EVENT]; } 
    611   time_t LastCheckedAutoResponse()      { return m_nLastCounters[LAST_CHECKED_AR]; } 
    612   time_t OnlineSince()              { return m_nOnlineSince; } 
    613   time_t IdleSince()                    { return m_nIdleSince; } 
    614   time_t RegisteredTime()               { return m_nRegisteredTime; } 
    615   bool UseGPG()             { return m_bUseGPG; } 
    616   char* GPGKey()            { return m_szGPGKey; } 
    617   bool AutoChatAccept()                 { return m_nAutoAccept & AUTO_ACCEPT_CHAT; } 
    618   bool AutoFileAccept()                 { return m_nAutoAccept & AUTO_ACCEPT_FILE; } 
    619   bool AutoSecure()                     { return m_nAutoAccept & AUTO_SECURE; } 
    620   bool AcceptInAway()                   { return m_nAutoAccept & ACCEPT_IN_AWAY; } 
    621   bool AcceptInNA()                     { return m_nAutoAccept & ACCEPT_IN_NA; } 
    622   bool AcceptInOccupied()               { return m_nAutoAccept & ACCEPT_IN_OCCUPIED; } 
    623   bool AcceptInDND()                    { return m_nAutoAccept & ACCEPT_IN_DND; } 
    624   unsigned short StatusToUser()         { return m_nStatusToUser; } 
    625   bool KeepAliasOnUpdate()              { return m_bKeepAliasOnUpdate; } 
    626   char *CustomAutoResponse()            { return m_szCustomAutoResponse; } 
    627   unsigned long PPID()                  { return m_nPPID; } 
    628   char *IdString()                      { return m_szId; } 
    629   bool NotInList()                      { return m_bNotInList; } 
    630  
    631   char *usprintf(const char *szFormat, unsigned long nFlags = 0); 
     599  char Mode() const                             { return m_nMode; } 
     600  unsigned long Version() const                 { return m_nVersion; } 
     601  const char* ClientInfo() const                { return m_szClientInfo; } 
     602  unsigned long ClientTimestamp() const         { return m_nClientTimestamp; } 
     603  unsigned long OurClientTimestamp() const      { return m_nOurClientTimestamp; } 
     604  unsigned long ClientInfoTimestamp() const     { return m_nClientInfoTimestamp; } 
     605  unsigned long OurClientInfoTimestamp() const  { return m_nOurClientInfoTimestamp; } 
     606  unsigned long ClientStatusTimestamp() const   { return m_nClientStatusTimestamp; } 
     607  unsigned long OurClientStatusTimestamp() const { return m_nOurClientStatusTimestamp; } 
     608  bool UserUpdated() const                      { return m_bUserUpdated; } 
     609  SecureChannelSupport_et SecureChannelSupport() const; 
     610  unsigned short LicqVersion() const; 
     611  unsigned short ConnectionVersion() const; 
     612  time_t LastOnline() const                     { return m_nLastCounters[LAST_ONLINE]; } 
     613  time_t LastSentEvent() const                  { return m_nLastCounters[LAST_SENT_EVENT]; } 
     614  time_t LastReceivedEvent() const              { return m_nLastCounters[LAST_RECV_EVENT]; } 
     615  time_t LastCheckedAutoResponse() const        { return m_nLastCounters[LAST_CHECKED_AR]; } 
     616  time_t OnlineSince() const                    { return m_nOnlineSince; } 
     617  time_t IdleSince() const                      { return m_nIdleSince; } 
     618  time_t RegisteredTime() const                 { return m_nRegisteredTime; } 
     619  bool UseGPG() const                           { return m_bUseGPG; } 
     620  const char* GPGKey() const                    { return m_szGPGKey; } 
     621  bool AutoChatAccept() const                   { return m_nAutoAccept & AUTO_ACCEPT_CHAT; } 
     622  bool AutoFileAccept() const                   { return m_nAutoAccept & AUTO_ACCEPT_FILE; } 
     623  bool AutoSecure() const                       { return m_nAutoAccept & AUTO_SECURE; } 
     624  bool AcceptInAway() const                     { return m_nAutoAccept & ACCEPT_IN_AWAY; } 
     625  bool AcceptInNA() const                       { return m_nAutoAccept & ACCEPT_IN_NA; } 
     626  bool AcceptInOccupied() const                 { return m_nAutoAccept & ACCEPT_IN_OCCUPIED; } 
     627  bool AcceptInDND() const                      { return m_nAutoAccept & ACCEPT_IN_DND; } 
     628  unsigned short StatusToUser() const           { return m_nStatusToUser; } 
     629  bool KeepAliasOnUpdate() const                { return m_bKeepAliasOnUpdate; } 
     630  char *CustomAutoResponse() const              { return m_szCustomAutoResponse; } 
     631  unsigned long PPID() const                    { return m_nPPID; } 
     632  const char* IdString() const                  { return m_szId; } 
     633  bool NotInList() const                        { return m_bNotInList; } 
     634 
     635  char* usprintf(const char* szFormat, unsigned long nFlags = 0) const; 
    632636 
    633637  // General Info 
     
    745749 
    746750  // Status 
    747   unsigned short Status(); 
    748   unsigned long StatusFull()   { return m_nStatus; } 
    749   bool StatusInvisible()       { return StatusOffline() ? false : m_nStatus & ICQ_STATUS_FxPRIVATE; } 
    750   bool StatusWebPresence()     {  return m_nStatus & ICQ_STATUS_FxWEBxPRESENCE; } 
    751   bool StatusHideIp()          { return m_nStatus & ICQ_STATUS_FxHIDExIP; } 
    752   bool StatusBirthday()        {  return m_nStatus & ICQ_STATUS_FxBIRTHDAY; } 
    753   bool StatusOffline()         {  return (unsigned short)m_nStatus == ICQ_STATUS_OFFLINE; } 
    754   unsigned long PhoneFollowMeStatus() { return m_nPhoneFollowMeStatus; } 
    755   unsigned long ICQphoneStatus()      { return m_nICQphoneStatus; } 
    756   unsigned long SharedFilesStatus()   { return m_nSharedFilesStatus; } 
     751  unsigned short Status() const; 
     752  unsigned long StatusFull() const              { return m_nStatus; } 
     753  bool StatusInvisible() const                  { return StatusOffline() ? false : m_nStatus & ICQ_STATUS_FxPRIVATE; } 
     754  bool StatusWebPresence() const                { return m_nStatus & ICQ_STATUS_FxWEBxPRESENCE; } 
     755  bool StatusHideIp() const                     { return m_nStatus & ICQ_STATUS_FxHIDExIP; } 
     756  bool StatusBirthday() const                   { return m_nStatus & ICQ_STATUS_FxBIRTHDAY; } 
     757  bool StatusOffline() const                    { return (unsigned short)m_nStatus == ICQ_STATUS_OFFLINE; } 
     758  unsigned long PhoneFollowMeStatus() const     { return m_nPhoneFollowMeStatus; } 
     759  unsigned long ICQphoneStatus() const          { return m_nICQphoneStatus; } 
     760  unsigned long SharedFilesStatus() const       { return m_nSharedFilesStatus; } 
    757761  void SetStatus(unsigned long n)  {  m_nStatus = n;  } 
    758762  void SetPhoneFollowMeStatus(unsigned long n)  { m_nPhoneFollowMeStatus = n; SaveLicqInfo(); } 
     
    760764  void SetSharedFilesStatus(unsigned long n)    { m_nSharedFilesStatus = n; }   
    761765  virtual void SetStatusOffline(); 
    762   const char *StatusStr(); 
    763   const char *StatusStrShort(); 
    764   bool Away(); 
    765   static const char *StatusToStatusStr(unsigned short, bool); 
    766   static const char *StatusToStatusStrShort(unsigned short, bool); 
     766  const char* StatusStr() const; 
     767  const char* StatusStrShort() const; 
     768  bool Away() const; 
     769  static const char* StatusToStatusStr(unsigned short n, bool b); 
     770  static const char* StatusToStatusStrShort(unsigned short n, bool b); 
    767771  static char *MakeRealId(const char *, unsigned long, char *&); 
    768   int Birthday(unsigned short nDayRange = 0); 
     772  int Birthday(unsigned short nDayRange = 0) const; 
    769773 
    770774  // Message/History functions 
    771   unsigned short NewMessages()   { return(m_vcMessages.size()); } 
     775  unsigned short NewMessages() const            { return(m_vcMessages.size()); } 
    772776  CUserEvent *EventPeek(unsigned short); 
     777  const CUserEvent* EventPeek(unsigned short index) const; 
    773778  CUserEvent *EventPeekId(int); 
    774   CUserEvent *EventPeekFirst(); 
    775   CUserEvent *EventPeekLast(); 
     779  const CUserEvent* EventPeekId(int id) const; 
     780  const CUserEvent* EventPeekFirst() const; 
     781  const CUserEvent* EventPeekLast() const; 
    776782  CUserEvent *EventPop(); 
    777783  void EventClear(unsigned short); 
     
    780786  void WriteToHistory(const char *); 
    781787  void SetHistoryFile(const char *); 
    782   int GetHistory(HistoryList &h)  { return m_fHistory.Load(h); } 
     788  int GetHistory(HistoryList& history) const    { return m_fHistory.Load(history); } 
    783789  static void ClearHistory(HistoryList &h)  { CUserHistory::Clear(h); } 
    784790  void SaveHistory(const char *buf)  { m_fHistory.Save(buf); } 
    785   const char *HistoryName()      { return m_fHistory.Description(); } 
    786   const char *HistoryFile()      { return m_fHistory.FileName(); } 
     791  const char* HistoryName() const               { return m_fHistory.Description(); } 
     792  const char* HistoryFile() const               { return m_fHistory.FileName(); } 
    787793 
    788794  /** 
     
    850856 
    851857  // Short cuts to above functions 
    852   bool InvisibleList() { return GetInGroup(GROUPS_SYSTEM, GROUP_INVISIBLE_LIST); } 
    853   bool VisibleList()   { return GetInGroup(GROUPS_SYSTEM, GROUP_VISIBLE_LIST); } 
    854   bool OnlineNotify() { return GetInGroup(GROUPS_SYSTEM, GROUP_ONLINE_NOTIFY); } 
    855   bool IgnoreList()    { return GetInGroup(GROUPS_SYSTEM, GROUP_IGNORE_LIST); } 
    856   bool NewUser()       { return GetInGroup(GROUPS_SYSTEM, GROUP_NEW_USERS); } 
     858  bool InvisibleList() const    { return GetInGroup(GROUPS_SYSTEM, GROUP_INVISIBLE_LIST); } 
     859  bool VisibleList() const      { return GetInGroup(GROUPS_SYSTEM, GROUP_VISIBLE_LIST); } 
     860  bool OnlineNotify() const    { return GetInGroup(GROUPS_SYSTEM, GROUP_ONLINE_NOTIFY); } 
     861  bool IgnoreList() const       { return GetInGroup(GROUPS_SYSTEM, GROUP_IGNORE_LIST); } 
     862  bool NewUser() const          { return GetInGroup(GROUPS_SYSTEM, GROUP_NEW_USERS); } 
    857863  void SetInvisibleList(bool s)  { SetInGroup(GROUPS_SYSTEM, GROUP_INVISIBLE_LIST, s); } 
    858864  void SetVisibleList(bool s)    { SetInGroup(GROUPS_SYSTEM, GROUP_VISIBLE_LIST, s); } 
     
    862868 
    863869  // Time 
    864   time_t LocalTime(); 
    865   int LocalTimeGMTOffset(); 
    866   int LocalTimeOffset(); 
     870  time_t LocalTime() const; 
     871  int LocalTimeGMTOffset() const; 
     872  int LocalTimeOffset() const; 
    867873  static int SystemTimeGMTOffset(); 
    868874  static char SystemTimezone(); 
    869875 
    870876  // Ip/Port functions 
    871   unsigned long Ip()        { return m_nIp; } 
    872   unsigned long IntIp()     { return m_nIntIp; } 
    873   unsigned short Port()     { return m_nPort; } 
    874   unsigned short LocalPort()    { return m_nLocalPort; } 
    875   unsigned long Cookie()    { return m_nCookie; } 
     877  unsigned long Ip() const                      { return m_nIp; } 
     878  unsigned long IntIp() const                   { return m_nIntIp; } 
     879  unsigned short Port() const                   { return m_nPort; } 
     880  unsigned short LocalPort() const              { return m_nLocalPort; } 
     881  unsigned long Cookie() const                  { return m_nCookie; } 
    876882  void SetIpPort(unsigned long nIp, unsigned short nPort); 
    877883  void SetIp(unsigned long nIp)     { SetIpPort(nIp, Port()); } 
     
    880886  void SetCookie(unsigned long nCookie) { m_nCookie = nCookie; } 
    881887 
    882   bool SendIntIp()      { return m_bSendIntIp; } 
     888  bool SendIntIp() const                        { return m_bSendIntIp; } 
    883889  void SetSendIntIp(bool s) { m_bSendIntIp = s; } 
    884890 
    885891  // for backward compatibility 
    886   unsigned long RealIp()          { return IntIp(); } 
     892  unsigned long RealIp() const                  { return IntIp(); } 
    887893  void SetRealIp(unsigned long s) { SetIntIp(s); } 
    888   bool SendRealIp()               { return SendIntIp(); } 
     894  bool SendRealIp() const                       { return SendIntIp(); } 
    889895  void SetSendRealIp(bool s)      { SetSendIntIp(s); } 
    890896 
    891   char *IpStr(char *rbuf); 
    892   char *IntIpStr(char *rbuf); 
    893   char *PortStr(char *rbuf); 
     897  char* IpStr(char* rbuf) const; 
     898  char* IntIpStr(char* rbuf) const; 
     899  char* PortStr(char* rbuf) const; 
    894900 
    895901  // User TLV List handling 
     
    900906 
    901907  // Don't call these: 
    902   int SocketDesc(unsigned char); 
     908  int SocketDesc(unsigned char channel) const; 
    903909  void ClearSocketDesc(unsigned char nChannel = 0x00); 
    904910  void SetSocketDesc(TCPSocket *); 
     
    910916 
    911917  // Last event functions 
    912   time_t Touched()       { return m_nTouched; } 
     918  time_t Touched() const                        { return m_nTouched; } 
    913919  void Touch()           {  m_nTouched = time(NULL); } 
    914920 
    915921  // Crypto 
    916   bool Secure() { return m_bSecure; } 
    917  
    918   virtual bool User() { return true; } 
     922  bool Secure() const                           { return m_bSecure; } 
     923 
     924  virtual bool User() const                    { return true; } 
    919925  void Lock(unsigned short lockType) const; 
    920926  void Unlock() const; 
     
    11431149  virtual void SetStatusOffline(); 
    11441150 
    1145   virtual bool User() { return false; } 
     1151  virtual bool User() const                    { return false; } 
    11461152protected: 
    11471153  char *m_szPassword; 
  • trunk/licq/src/history.cpp

    r6405 r6462  
    148148  } 
    149149 
    150 bool CUserHistory::Load(HistoryList &lHistory) 
     150bool CUserHistory::Load(HistoryList &lHistory) const 
    151151{ 
    152152  if (m_szFileName == NULL) 
  • trunk/licq/src/icqd-srv.cpp

    r6438 r6462  
    282282  // Get their old SID 
    283283  ICQUser* u = gUserManager.FetchUser(_szId, _nPPID, LOCK_R); 
    284   char* alias = u->GetAlias(); 
     284  const char* alias = u->GetAlias(); 
    285285  int nSID = u->GetSID(); 
    286286  gUserManager.DropUser(u); 
     
    476476  ICQUser *u = gUserManager.FetchUser(_szId, LICQ_PPID, LOCK_R); 
    477477  if (u == NULL) return; 
    478   char *szNewAlias = u->GetAlias(); 
     478  const char* szNewAlias = u->GetAlias(); 
    479479  gUserManager.DropUser(u); 
    480480 
     
    25692569    { 
    25702570      gLog.Info(tr("%sReceived user information for %s.\n"), L_SRVxSTR, szId); 
     2571      gTranslator.ServerToClient(szInfo); 
    25712572      ICQUser *u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 
    25722573      u->SetEnableSave(false); 
     
    25752576 
    25762577      // translating string with Translation Table 
    2577       gTranslator.ServerToClient(u->GetAbout()); 
    25782578 
    25792579      delete [] szId; 
     
    52085208 
    52095209          // translating string with Translation Table