Show
Ignore:
Timestamp:
05/02/03 10:13:43 (6 years ago)
Author:
emostar
Message:

Removing user support

Location:
branches/protocol_plugin_1_3_0/licq
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/protocol_plugin_1_3_0/licq/include/licq_icqd.h

    r3474 r3482  
    238238  void icqAddGroup(const char *); 
    239239  void icqRemoveUser(unsigned long _nUin); 
     240  void icqRemoveUser(const char *); 
    240241  void icqRemoveGroup(const char *); 
    241242  void icqChangeGroup(unsigned long _nUin, unsigned short _nNewGroup, 
     
    297298  void AddUserToList(ICQUser *); 
    298299  void RemoveUserFromList(unsigned long _nUin); 
    299  
     300  void RemoveUserFromList(const char *szId, unsigned long nPPID); 
     301   
    300302  // SMS 
    301303  unsigned long icqSendSms(const char *szNumber, const char *szMessage, 
  • branches/protocol_plugin_1_3_0/licq/src/icqd-srv.cpp

    r3478 r3482  
    293293  else 
    294294    PushProtoSignal(new CRemoveUserSignal(_szId), _nPPID); 
     295} 
     296 
     297void CICQDaemon::icqRemoveUser(const char *_szId) 
     298{ 
     299  // Remove from the SSList and update groups 
     300  if (UseServerContactList()) 
     301  { 
     302    CSrvPacketTcp *pStart = new CPU_GenericFamily(ICQ_SNACxFAM_LIST, 
     303      ICQ_SNACxLIST_ROSTxEDITxSTART); 
     304    SendEvent_Server(pStart); 
     305 
     306    ICQUser *u = gUserManager.FetchUser(_szId, LICQ_PPID, LOCK_W); 
     307    unsigned short nGSID = u->GetGSID(); 
     308    unsigned short nSID = u->GetSID(); 
     309    u->SetGSID(0); 
     310    gUserManager.DropUser(u); 
     311 
     312    pthread_mutex_lock(&mutex_modifyserverusers); 
     313    m_lszModifyServerUsers.push_back(strdup(_szId)); 
     314    pthread_mutex_unlock(&mutex_modifyserverusers); 
     315 
     316    CSrvPacketTcp *pRemove = new CPU_RemoveFromServerList(_szId, nGSID, nSID, ICQ_ROSTxNORMAL); 
     317    SendExpectEvent_Server(0, pRemove, NULL); 
     318  } 
     319 
     320  // Tell server they are no longer with us. 
     321  CSrvPacketTcp *p = new CPU_GenericUinList(_szId, ICQ_SNACxFAM_BUDDY, ICQ_SNACxBDY_REMOVExFROMxLIST); 
     322  gLog.Info("%sAlerting server to remove user (#%ld)...\n", L_SRVxSTR, 
     323            p->Sequence()); 
     324  SendExpectEvent_Server(_szId, LICQ_PPID, p, NULL); 
    295325} 
    296326 
  • branches/protocol_plugin_1_3_0/licq/src/icqd.cpp

    r3469 r3482  
    10091009} 
    10101010 
     1011void CICQDaemon::RemoveUserFromList(const char *szId, unsigned long nPPID) 
     1012{ 
     1013  if (nPPID == LICQ_PPID && m_nTCPSrvSocketDesc != -1) icqRemoveUser(szId); 
     1014   
     1015  gUserManager.RemoveUser(szId, nPPID); 
     1016  SaveUserList(); 
     1017   
     1018  PushPluginSignal(new CICQSignal(SIGNAL_UPDATExLIST, LIST_REMOVE, szId, 
     1019    nPPID)); 
     1020} 
    10111021 
    10121022//-----ChangeUserStatus-------------------------------------------------------