Changeset 3469 for branches/protocol_plugin_1_3_0
- Timestamp:
- 05/01/03 09:58:19 (6 years ago)
- Location:
- branches/protocol_plugin_1_3_0/licq/src
- Files:
-
- 12 modified
-
history.cpp (modified) (3 diffs)
-
icqd-srv.cpp (modified) (39 diffs)
-
icqd-tcp.cpp (modified) (4 diffs)
-
icqd.cpp (modified) (11 diffs)
-
icqevent.cpp (modified) (14 diffs)
-
icqpacket.cpp (modified) (4 diffs)
-
licq.cpp (modified) (4 diffs)
-
licq.h (modified) (3 diffs)
-
message.cpp (modified) (24 diffs)
-
socket.cpp (modified) (10 diffs)
-
user.cpp (modified) (52 diffs)
-
utility.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/protocol_plugin_1_3_0/licq/src/history.cpp
r3418 r3469 21 21 #include "licq_message.h" 22 22 #include "licq_icq.h" 23 24 #ifdef PROTOCOL_PLUGIN25 23 #include "licq_user.h" 24 25 //A sleazy hack 26 26 extern char *PPIDSTRING(unsigned long); 27 #endif28 27 29 28 #define MAX_HISTORY_MSG_SIZE 8192 … … 40 39 } 41 40 42 #ifdef PROTOCOL_PLUGIN43 41 void CUserHistory::SetFile(const char *_sz, unsigned long _nUin) 44 42 { … … 79 77 } 80 78 } 81 #else82 void CUserHistory::SetFile(const char *_sz, unsigned long _nUin)83 {84 if (m_szFileName != NULL) free(m_szFileName);85 if (m_szDescription != NULL) free(m_szDescription);86 87 // default history filename, compare only first 7 chars in case of spaces88 if (strncmp(_sz, "default", 7) == 0)89 {90 char temp[MAX_FILENAME_LEN];91 snprintf(temp, MAX_FILENAME_LEN, "%s/%s/%ld.%s", BASE_DIR,92 HISTORY_DIR, _nUin, HISTORY_EXT);93 temp[sizeof(temp) - 1] = '\0';94 m_szFileName = strdup(temp);95 m_szDescription = strdup("default");96 }97 // no history file98 else if (strncmp(_sz, "none", 4) == 0) // no history file99 {100 m_szFileName = NULL;101 m_szDescription = strdup("none");102 }103 // use given name104 else105 {106 m_szFileName = strdup(_sz);107 m_szDescription = strdup(_sz);108 }109 }110 #endif111 79 112 80 /* szResult[0] != ':' doubles to check if strlen(szResult) < 1 */ -
branches/protocol_plugin_1_3_0/licq/src/icqd-srv.cpp
r3466 r3469 26 26 #include "support.h" 27 27 #include "licq_message.h" 28 29 #ifdef PROTOCOL_PLUGIN30 28 #include "licq_protoplugind.h" 31 29 … … 38 36 PushProtoSignal(new CAddUserSignal(_szId, _bAuthRequired), _nPPID); 39 37 } 40 #endif41 38 42 39 //-----icqAddUser---------------------------------------------------------- 43 #ifdef PROTOCOL_PLUGIN44 40 void CICQDaemon::icqAddUser(const char *_szId, bool _bAuthRequired) 45 41 { … … 57 53 //icqUserBasicInfo(_nUin); 58 54 } 59 #endif60 55 61 56 void CICQDaemon::icqAddUser(unsigned long _nUin, bool _bAuthRequired) 62 57 { 63 #ifdef PROTOCOL_PLUGIN64 58 char szUin[24]; 65 59 sprintf(szUin, "%lu", _nUin); 66 60 CSrvPacketTcp *p = new CPU_GenericUinList(szUin, ICQ_SNACxFAM_BUDDY, ICQ_SNACxBDY_ADDxTOxLIST); 67 #else68 CSrvPacketTcp *p = new CPU_GenericUinList(_nUin, ICQ_SNACxFAM_BUDDY, ICQ_SNACxBDY_ADDxTOxLIST);69 #endif70 61 gLog.Info("%sAlerting server to new user (#%ld)...\n", L_SRVxSTR, 71 62 p->Sequence()); 72 SendExpectEvent_Server( _nUin, p, NULL);63 SendExpectEvent_Server(szUin, LICQ_PPID, p, NULL); 73 64 74 65 // Server side list add, and update of group … … 292 283 293 284 //-----icqRemoveUser------------------------------------------------------- 294 #ifdef PROTOCOL_PLUGIN295 285 void CICQDaemon::ProtoRemoveUser(const char *_szId, unsigned long _nPPID) 296 286 { … … 300 290 PushProtoSignal(new CRemoveUserSignal(_szId), _nPPID); 301 291 } 302 #endif303 292 304 293 void CICQDaemon::icqRemoveUser(unsigned long _nUin) … … 408 397 409 398 //-----icqFetchAutoResponseServer----------------------------------------------- 410 #ifdef PROTOCOL_PLUGIN411 399 unsigned long CICQDaemon::ProtoFetchAutoResponseServer(const char *_szId, unsigned long _nPPID) 412 400 { … … 420 408 return nRet; 421 409 } 422 #endif423 410 424 411 unsigned long CICQDaemon::icqFetchAutoResponseServer(unsigned long _nUin) … … 548 535 549 536 //-----icqSetStatus------------------------------------------------------------- 550 #ifdef PROTOCOL_PLUGIN551 537 unsigned long CICQDaemon::ProtoSetStatus(unsigned long _nPPID, 552 538 unsigned short _nNewStatus) … … 561 547 return nRet; 562 548 } 563 #endif564 549 565 550 unsigned long CICQDaemon::icqSetStatus(unsigned short newStatus) … … 1087 1072 1088 1073 //-----icqSendThroughServer----------------------------------------------------- 1089 #ifdef PROTOCOL_PLUGIN1090 1074 ICQEvent* CICQDaemon::icqSendThroughServer(const char *szId, 1091 1075 unsigned char format, char *_sMessage, CUserEvent* ue) … … 1122 1106 return result; 1123 1107 } 1124 #endif1125 1108 1126 1109 ICQEvent* CICQDaemon::icqSendThroughServer(unsigned long nUin, unsigned char format, char *_sMessage, CUserEvent* ue) 1127 1110 { 1128 ICQEvent* result; 1129 1130 CPU_ThroughServer *p = new CPU_ThroughServer(nUin, format, _sMessage); 1131 1132 switch (format) 1133 { 1134 case ICQ_CMDxSUB_MSG: 1135 gLog.Info("%sSending message through server (#%ld).\n", L_SRVxSTR, p->Sequence()); 1136 break; 1137 case ICQ_CMDxSUB_URL: 1138 gLog.Info("%sSending url through server (#%ld).\n", L_SRVxSTR, p->Sequence()); 1139 break; 1140 case ICQ_CMDxSUB_CONTACTxLIST: 1141 gLog.Info("%sSending contact list through server (#%ld).\n", L_SRVxSTR, p->Sequence()); 1142 break; 1143 default: 1144 gLog.Info("%sSending misc through server (#%ld).\n", L_SRVxSTR, p->Sequence()); 1145 } 1146 1147 // If we are already shutting down, don't start any events 1148 if (m_bShuttingDown) return NULL; 1149 1150 if (ue != NULL) ue->m_eDir = D_SENDER; 1151 ICQEvent *e = new ICQEvent(this, m_nTCPSrvSocketDesc, p, CONNECT_SERVER, nUin, ue); 1152 if (e == NULL) return 0; 1153 e->m_NoAck = true; 1154 1155 result = SendExpectEvent(e, &ProcessRunningEvent_Server_tep); 1156 return result; 1111 char szUin[24]; 1112 sprintf(szUin, "%lu", nUin); 1113 return icqSendThroughServer(szUin, format, _sMessage, ue); 1157 1114 } 1158 1115 … … 1259 1216 1260 1217 //-----ICQ::Logon-------------------------------------------------------------- 1261 #ifdef PROTOCOL_PLUGIN1262 1218 unsigned long CICQDaemon::ProtoLogon(unsigned long _nPPID, unsigned short _nLogonStatus) 1263 1219 { … … 1271 1227 return nRet; 1272 1228 } 1273 #endif1274 1229 1275 1230 unsigned long CICQDaemon::icqLogon(unsigned short logonStatus) … … 1318 1273 1319 1274 //-----ICQ::icqLogoff----------------------------------------------------------- 1320 #ifdef PROTOCOL_PLUGIN1321 1275 void CICQDaemon::ProtoLogoff(unsigned long _nPPID) 1322 1276 { … … 1326 1280 PushProtoSignal(new CLogoffSignal(), _nPPID); 1327 1281 } 1328 #endif 1282 1329 1283 void CICQDaemon::icqLogoff() 1330 1284 { … … 1847 1801 case ICQ_SNACxSUB_ONLINExLIST: 1848 1802 { 1849 unsigned long junk1, intIP, userPort, nUin,timestamp, nCookie;1803 unsigned long junk1, intIP, userPort, timestamp, nCookie; 1850 1804 unsigned short junk2; 1851 1805 unsigned char mode; … … 1854 1808 junk1 = packet.UnpackUnsignedLongBE(); 1855 1809 junk2 = packet.UnpackUnsignedShortBE(); 1856 #ifdef PROTOCOL_PLUGIN1857 1810 szId = packet.UnpackUserString(); 1858 #else1859 nUin = packet.UnpackUinString();1860 #endif1861 1811 1862 1812 junk1 = packet.UnpackUnsignedLongBE(); // tlvcount … … 1870 1820 // rev_e_long(userIP); 1871 1821 1872 #ifdef PROTOCOL_PLUGIN1873 1822 ICQUser *u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 1874 delete [] szId;1875 #else1876 ICQUser *u = gUserManager.FetchUser(nUin, LOCK_W);1877 #endif1878 1823 if (u == NULL) 1879 1824 { 1880 gLog.Warn("%sUnknown user (%ld) changed status.\n", L_WARNxSTR, 1881 nUin); 1825 gLog.Warn("%sUnknown user (%s) changed status.\n", L_WARNxSTR, 1826 szId); 1827 delete [] szId; 1882 1828 break; 1883 1829 } 1884 1830 delete [] szId; 1885 1831 1886 1832 // 0 if not set -> Online … … 1924 1870 u->SetIdleSince(0); 1925 1871 1926 if (packet.getTLVLen(0x000c) == 0x25) { 1872 if (packet.getTLVLen(0x000c) == 0x25) 1873 { 1927 1874 CBuffer msg = packet.UnpackTLV(0x000c); 1928 1875 … … 1963 1910 { 1964 1911 ChangeUserStatus(u, nNewStatus); 1965 gLog.Info("%s%s (% ld) changed status: %s (v%01x)%s.\n", L_SRVxSTR, u->GetAlias(),1966 nUin, u->StatusStr(), tcpVersion & 0x0F, szExtraInfo);1912 gLog.Info("%s%s (%s) changed status: %s (v%01x)%s.\n", L_SRVxSTR, u->GetAlias(), 1913 u->IdString(), u->StatusStr(), tcpVersion & 0x0F, szExtraInfo); 1967 1914 if ( (nNewStatus & ICQ_STATUS_FxUNKNOWNxFLAGS) ) 1968 gLog.Unknown("%sUnknown status flag for %s (%ld): 0x%08lX\n", 1969 L_UNKNOWNxSTR, u->GetAlias(), nUin, (nNewStatus & ICQ_STATUS_FxUNKNOWNxFLAGS)); 1915 gLog.Unknown("%sUnknown status flag for %s (%s): 0x%08lX\n", 1916 L_UNKNOWNxSTR, u->GetAlias(), u->IdString(), 1917 (nNewStatus & ICQ_STATUS_FxUNKNOWNxFLAGS)); 1970 1918 nNewStatus &= ICQ_STATUS_FxUNKNOWNxFLAGS; 1971 1919 u->SetAutoResponse(NULL); … … 1993 1941 if (mode != MODE_DIRECT && mode != MODE_INDIRECT) 1994 1942 { 1995 gLog.Unknown("%sUnknown peer-to-peer mode for %s (% ld): %d\n", L_UNKNOWNxSTR,1996 u->GetAlias(), u-> Uin(), mode);1943 gLog.Unknown("%sUnknown peer-to-peer mode for %s (%s): %d\n", L_UNKNOWNxSTR, 1944 u->GetAlias(), u->IdString(), mode); 1997 1945 u->SetMode(MODE_DIRECT); 1998 1946 u->SetSendServer(false); … … 2004 1952 } 2005 1953 } 2006 #ifdef PROTOCOL_PLUGIN2007 1954 else // for AIM users 2008 1955 { … … 2010 1957 { 2011 1958 ChangeUserStatus(u, nNewStatus); 2012 gLog.Info("%s%s (%s)changed status: %s (AIM).\n", L_SRVxSTR, u->GetAlias(),2013 u-> IdString(), u->StatusStr());1959 gLog.Info("%s%s changed status: %s (AIM).\n", L_SRVxSTR, u->GetAlias(), 1960 u->StatusStr()); 2014 1961 if ( (nNewStatus & ICQ_STATUS_FxUNKNOWNxFLAGS) ) 2015 gLog.Unknown("%sUnknown status flag for %s (%s): 0x%08lX\n",2016 L_UNKNOWNxSTR, u->GetAlias(), u->IdString(),1962 gLog.Unknown("%sUnknown status flag for %s: 0x%08lX\n", 1963 L_UNKNOWNxSTR, u->GetAlias(), 2017 1964 nNewStatus & ICQ_STATUS_FxUNKNOWNxFLAGS); 2018 1965 u->SetAutoResponse(NULL); … … 2020 1967 } 2021 1968 } 2022 #endif2023 1969 2024 1970 // We are no longer able to differentiate oncoming users from the … … 2032 1978 case ICQ_SNACxSUB_OFFLINExLIST: 2033 1979 { 2034 unsigned long junk1 , nUin;1980 unsigned long junk1; 2035 1981 unsigned short junk2; 1982 char *szId; 2036 1983 2037 1984 junk1 = packet.UnpackUnsignedLongBE(); 2038 1985 junk2 = packet.UnpackUnsignedShortBE(); 2039 2040 nUin = packet.UnpackUinString(); 2041 2042 ICQUser *u = gUserManager.FetchUser(nUin, LOCK_W); 1986 szId = packet.UnpackUserString(); 1987 1988 ICQUser *u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 2043 1989 if (u == NULL) 2044 1990 { 2045 gLog.Warn("%sUnknown user (%ld) has gone offline.\n", L_WARNxSTR, nUin); 1991 gLog.Warn("%sUnknown user (%s) has gone offline.\n", L_WARNxSTR, szId); 1992 delete [] szId; 2046 1993 break; 2047 1994 } 2048 gLog.Info("%s%s (%ld) went offline.\n", L_SRVxSTR, u->GetAlias(), nUin); 1995 delete [] szId; 1996 1997 gLog.Info("%s%s went offline.\n", L_SRVxSTR, u->GetAlias()); 2049 1998 u->SetClientTimestamp(0); 2050 1999 ChangeUserStatus(u, ICQ_STATUS_OFFLINE); … … 2114 2063 nTimeSent = time(0L); 2115 2064 mFormat = packet.UnpackUnsignedShortBE(); 2116 #ifdef PROTOCOL_PLUGIN2117 2065 szId = packet.UnpackUserString(); 2118 #else 2119 nUin = packet.UnpackUinString(); 2120 2121 if (nUin < 10000 && nUin != ICQ_UINxPAGER && nUin != ICQ_UINxSMS) 2122 { 2123 gLog.Warn("%sMessage through server with strange Uin: %04lx\n", L_WARNxSTR, nUin); 2124 break; 2125 } 2126 #endif 2066 2067 //TODO Check this again with new protocol plugin support 2068 //if (nUin < 10000 && nUin != ICQ_UINxPAGER && nUin != ICQ_UINxSMS) 2069 //{ 2070 // gLog.Warn("%sMessage through server with strange Uin: %04lx\n", L_WARNxSTR, nUin); 2071 // break; 2072 //} 2127 2073 2128 2074 packet.UnpackUnsignedShortBE(); // warning level ? … … 2174 2120 2175 2121 // Lock the user to add the message to their queue 2176 #ifdef PROTOCOL_PLUGIN2177 2122 ICQUser *u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 2178 #else2179 ICQUser* u = gUserManager.FetchUser(nUin, LOCK_W);2180 #endif2181 2123 if (u == NULL) 2182 2124 { 2183 2125 if (Ignore(IGNORE_NEWUSERS)) 2184 2126 { 2185 gLog.Info("%sMessage from new user (%ld), ignoring.\n", L_SBLANKxSTR, nUin); 2186 RejectEvent(nUin, e); 2127 gLog.Info("%sMessage from new user (%s), ignoring.\n", L_SBLANKxSTR, szId); 2128 //TODO 2129 RejectEvent(strtoul(szId, (char **)NULL, 10), e); 2187 2130 break; 2188 2131 } 2189 gLog.Info("%sMessage from new user (% ld).\n",2190 L_SBLANKxSTR, nUin);2191 #ifdef PROTOCOL_PLUGIN 2132 gLog.Info("%sMessage from new user (%s).\n", 2133 L_SBLANKxSTR, szId); 2134 2192 2135 AddUserToList(szId, LICQ_PPID); 2193 2136 u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 2194 #else2195 2196 AddUserToList(nUin);2197 u = gUserManager.FetchUser(nUin, LOCK_W);2198 #endif2199 2137 } 2200 2138 else 2201 #ifdef PROTOCOL_PLUGIN2202 2139 gLog.Info("%sMessage through server from %s (%s).\n", L_SRVxSTR, 2203 2140 u->GetAlias(), szId); 2204 #else2205 gLog.Info("%sMessage through server from %s (%ld).\n", L_SRVxSTR,2206 u->GetAlias(), nUin);2207 #endif2208 2209 #ifdef PROTOCOL_PLUGIN2210 if (szId)2211 delete [] szId;2212 #endif2213 2141 2214 2142 if (AddUserEvent(u, e)) … … 2280 2208 2281 2209 bool bNewUser = false; 2282 #ifdef PROTOCOL_PLUGIN2283 2210 ICQUser *u = gUserManager.FetchUser(szId, LICQ_PPID, LOCK_W); 2284 #else2285 ICQUser *u = gUserManager.FetchUser(nUin, LOCK_W);2286 #endif2287 2211 if (u == NULL) 2288 2212 { 2289 #ifdef PROTOCOL_PLUGIN2290 2213 u = new ICQUser(szId, LICQ_PPID); 2291 #else2292 u = new ICQUser(nUin);2293 #endif2294 2214 bNewUser = true; 2295 2215 } 2296 #ifdef PROTOCOL_PLUGIN2297 if (szId)2298 delete [] szId;2299 #endif2300 2216 2301 2217 if (msgTxt.getTLVLen(0x0004) == 4) … … 2313 2229 bool r = u->OfflineOnDisconnect() || u->StatusOffline(); 2314 2230 ChangeUserStatus(u, (u->StatusFull() & ICQ_STATUS_FxFLAGS) | nStatus); 2315 gLog.Info("%s%s (% ld) is %s to us.\n", L_TCPxSTR, u->GetAlias(),2316 u-> Uin(), u->StatusStr());2231 gLog.Info("%s%s (%s) is %s to us.\n", L_TCPxSTR, u->GetAlias(), 2232 u->IdString(), u->StatusStr()); 2317 2233 if (r) u->SetOfflineOnDisconnect(true); 2318 2234 } … … 2349 2265 unsigned short nTypeSMS = msgTxt.UnpackUnsignedShort(); 2350 2266 switch (nTypeSMS) 2351 {2267 { 2352 2268 case 0x0000: 2353 // SMS 2354 break; 2355 case 0x0002: 2356 // SMS Receipt: Success (meanwhile, we handle it in a rather lame way) 2357 gLog.Unknown("%sReceived SMS receipt indicating success.\n", L_UNKNOWNxSTR); 2358 return; 2359 case 0x0003: 2360 // SMS Receipt : Failure 2361 gLog.Unknown("%sReceived SMS receipt indicating failure.\n", L_UNKNOWNxSTR); 2362 return; 2363 default: 2364 char *buf; 2365 gLog.Unknown("%sUnknown SMS subtype (0x%04x):\n%s\n", L_UNKNOWNxSTR, nTypeSMS, packet.print(buf)); 2366 delete [] buf; 2367 return; 2368 } 2369 2370 unsigned long nTagLength = msgTxt.UnpackUnsignedLong(); 2371 // Refuse irreasonable tag sizes 2372 if (nTagLength > 255) 2373 { 2374 gLog.Unknown("%sInvalid tag in SMS message.", L_UNKNOWNxSTR); 2375 return; 2376 } 2377 2378 char* szTag = new char[nTagLength + 1]; 2379 for (unsigned long i = 0; i < nTagLength; ++i) 2380 szTag[i] = msgTxt.UnpackChar(); 2381 szTag[nTagLength] = '\0'; 2382 2383 if (strcmp(szTag, "ICQSMS") != 0) 2384 { 2385 gLog.Unknown("%sUnknown tag in SMS message:\n%s\n", L_UNKNOWNxSTR, szTag); 2269 // SMS 2270 break; 2271 case 0x0002: 2272 // SMS Receipt: Success (meanwhile, we handle it in a rather lame way) 2273 gLog.Unknown("%sReceived SMS receipt indicating success.\n", L_UNKNOWNxSTR); 2274 return; 2275 case 0x0003: 2276 // SMS Receipt : Failure 2277 gLog.Unknown("%sReceived SMS receipt indicating failure.\n", L_UNKNOWNxSTR); 2278 return; 2279 default: 2280 { 2281 char *buf; 2282 gLog.Unknown("%sUnknown SMS subtype (0x%04x):\n%s\n", L_UNKNOWNxSTR, 2283 nTypeSMS, packet.print(buf)); 2284 delete [] buf; 2285 return; 2286 } 2287 } 2288 2289 unsigned long nTagLength = msgTxt.UnpackUnsignedLong(); 2290 // Refuse irreasonable tag sizes 2291 if (nTagLength > 255) 2292 { 2293 gLog.Unknown("%sInvalid tag in SMS message.", L_UNKNOWNxSTR); 2294 return; 2295 } 2296 2297 char* szTag = new char[nTagLength + 1]; 2298 for (unsigned long i = 0; i < nTagLength; ++i) 2299 szTag[i] = msgTxt.UnpackChar(); 2300 szTag[nTagLength] = '\0'; 2301 2302 if (strcmp(szTag, "ICQSMS") != 0) 2303 { 2304 gLog.Unknown("%sUnknown tag in SMS message:\n%s\n", L_UNKNOWNxSTR, 2305 szTag); 2386 2306 delete [] szTag; 2387 2307 return; … … 2395 2315 // Refuse irreasonable SMS sizes (something must've went wrong) 2396 2316 if (nSMSLength > 0x7fff) 2397 { 2398 gLog.Unknown("%sSMS message packet was too large (claimed size: %lu bytes)\n", L_UNKNOWNxSTR, nSMSLength); 2317 { 2318 gLog.Unknown("%sSMS message packet was too large (claimed size: %lu bytes)\n", 2319 L_UNKNOWNxSTR, nSMSLength); 2399 2320 return; 2400 2321 } … … 2420 2341 unsigned short nTypeEvent = 0; 2421 2342 CUserEvent *eEvent = NULL; 2422 2343 2423 2344 switch(nTypeMsg) 2424 2345 { 2425 case ICQ_CMDxSUB_MSG: 2426 { 2427 CEventMsg *e = CEventMsg::Parse(szMessage, ICQ_CMDxRCV_SYSxMSGxONLINE, nTimeSent, nMask); 2428 szType = strdup("Message"); 2429 nTypeEvent = ON_EVENT_MSG; 2430 eEvent = e; 2431 break; 2432 } 2433 case ICQ_CMDxSUB_URL: 2434 { 2435 CEventUrl *e = CEventUrl::Parse(szMessage, ICQ_CMDxRCV_SYSxMSGxONLINE, nTimeSent, nMask); 2436 if (e == NULL) 2437 { 2438 char *buf; 2439 2440 gLog.Warn("%sInvalid URL message:\n%s\n", L_WARNxSTR, packet.print(buf)); 2441 delete [] buf; 2442 break; 2443 } 2444 szType = strdup("URL"); 2445 nTypeEvent = ON_EVENT_URL; 2446 eEvent = e; 2447 break; 2448 } 2449 case ICQ_CMDxSUB_AUTHxREQUEST: 2450 { 2451 gLog.Info("%sAuthorization request from %ld.\n", L_SBLANKxSTR, nUin); 2452 2453 char **szFields = new char *[6]; // alias, first name, last name, email, auth, comment 2454 2455 if (!ParseFE(szMessage, &szFields, 6)) 2456 { 2457 char *buf; 2458 2459 gLog.Warn("%sInvalid authorization request system message:\n%s\n", L_WARNxSTR, 2346 case ICQ_CMDxSUB_MSG: 2347 { 2348 CEventMsg *e = CEventMsg::Parse(szMessage, ICQ_CMDxRCV_SYSxMSGxONLINE, nTimeSent, nMask); 2349 szType = strdup("Message"); 2350 nTypeEvent = ON_EVENT_MSG; 2351 eEvent = e; 2352 break; 2353 } 2354 case ICQ_CMDxSUB_URL: 2355 { 2356 CEventUrl *e = CEventUrl::Parse(szMessage, ICQ_CMDxRCV_SYSxMSGxONLINE, nTimeSent, nMask); 2357 if (e == NULL) 2358 { 2359 char *buf; 2360 gLog.Warn("%sInvalid URL message:\n%s\n", L_WARNxSTR, packet.print(buf)); 2361 delete [] buf; 2362 break; 2363 } 2364 szType = strdup("URL"); 2365 nTypeEvent = ON_EVENT_URL; 2366 eEvent = e; 2367 break; 2368 } 2369 case ICQ_CMDxSUB_AUTHxREQUEST: 2370 { 2371 gLog.Info("%sAuthorization request from %s.\n", L_SBLANKxSTR, szId); 2372 char **szFields = new char *[6]; // alias, first name, last name, email, auth, comment 2373 2374 if (!ParseFE(szMessage, &szFields, 6)) 2375 { 2376 char *buf; 2377 gLog.Warn("%sInvalid authorization request system message:\n%s\n", L_WARNxSTR, 2460 2378 packet.print(buf)); 2461 2462 delete [] buf; 2463 delete [] szFields; 2464 break; 2465 } 2466 2467 // translating string with Translation Table 2468 gTranslator.ServerToClient (szFields[0]); // alias 2469 gTranslator.ServerToClient (szFields[1]); // first name 2470 gTranslator.ServerToClient (szFields[2]); // last name 2471 gTranslator.ServerToClient (szFields[5]); // comment 2472 2473 CEventAuthRequest *e = new CEventAuthRequest(nUin, szFields[0], 2379 delete [] buf; 2380 delete [] szFields; 2381 break; 2382 } 2383 2384 // translating string with Translation Table 2385 gTranslator.ServerToClient (szFields[0]); // alias 2386 gTranslator.ServerToClient (szFields[1]); // first name 2387 &n
