Changeset 4081 for trunk/rms

Show
Ignore:
Timestamp:
04/20/05 22:20:58 (4 years ago)
Author:
emostar
Message:

Add some support for the multi-protocol features now. Doesn't work with MSN yet, but we can use it with AIM users now.

Location:
trunk/rms/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/rms/src/rms.cpp

    r3593 r4081  
    829829  if (*data_arg == '\0') 
    830830  { 
    831     strcpy(format, "%9u %-20a %3m %s"); 
     831    strcpy(format, "%u %-20a %3m %s"); 
    832832  } 
    833833  else 
     
    871871int CRMSClient::Process_MESSAGE() 
    872872{ 
    873   unsigned long nUin = strtoul(data_arg, (char**)NULL, 10); 
    874  
    875   if (nUin < 10000) 
    876   { 
    877     fprintf(fs, "%d Invalid UIN.\n", CODE_INVALIDxUSER); 
    878     return fflush(fs); 
    879   } 
     873//  unsigned long nUin = strtoul(data_arg, (char**)NULL, 10); 
     874 
     875//  if (nUin < 10000) 
     876//  { 
     877//    fprintf(fs, "%d Invalid UIN.\n", CODE_INVALIDxUSER); 
     878//    return fflush(fs); 
     879//  } 
    880880 
    881881  fprintf(fs, "%d Enter message, terminate with a . on a line by itself:\n", 
    882882     CODE_ENTERxTEXT); 
    883883 
    884   m_nUin = nUin; 
     884//  m_nUin = nUin; 
     885  m_szId = strdup(data_arg); 
    885886  m_szText[0] = '\0'; 
    886887  m_nTextPos = 0; 
     
    892893int CRMSClient::Process_MESSAGE_text() 
    893894{ 
    894   unsigned long tag = licqDaemon->icqSendMessage(m_nUin, m_szText, false, ICQ_TCPxMSG_NORMAL); 
    895  
    896   fprintf(fs, "%d [%ld] Sending message to %ld.\n", CODE_COMMANDxSTART, 
    897      tag, m_nUin); 
     895  unsigned long tag = licqDaemon->icqSendMessage(m_szId, m_szText, false, ICQ_TCPxMSG_NORMAL); 
     896 
     897  fprintf(fs, "%d [%ld] Sending message to %s.\n", CODE_COMMANDxSTART, 
     898     tag, m_szId); 
    898899 
    899900  tags.push_back(tag); 
     
    11431144{ 
    11441145  unsigned long nUin = 0; 
     1146  char *szId = 0; 
    11451147 
    11461148  if (*data_arg != '\0') 
    11471149  { 
    11481150    nUin = strtoul(data_arg, (char**)NULL, 10); 
     1151    szId = strdup(data_arg); 
    11491152  } 
    11501153  else 
     
    11561159    { 
    11571160      if(pUser->NewMessages() > 0) 
    1158         nUin = pUser->Uin(); 
     1161        szId = strdup(pUser->IdString()); 
    11591162    } 
    11601163    FOR_EACH_USER_END 
    11611164   
    1162     if (nUin == 0) 
     1165    if (szId == 0) 
    11631166    { 
    11641167      fprintf(fs, "%d No new messages.\n", CODE_VIEWxNONE); 
     
    11671170  } 
    11681171 
    1169   ICQUser *u = gUserManager.FetchUser(nUin, LOCK_W); 
     1172  ICQUser *u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 
    11701173  if (u == NULL) 
    11711174  { 
     
    12311234  gUserManager.DropUser(u); 
    12321235 
     1236  if (szId) free(szId); 
    12331237  return fflush(fs); 
    12341238} 
  • trunk/rms/src/rms.h

    r3593 r4081  
    9696 
    9797  unsigned long m_nUin; 
     98  char *m_szId; 
    9899  char m_szText[MAX_TEXT_LENGTH + 1]; 
    99100  char m_szLine[MAX_LINE_LENGTH + 1];