Changeset 3801 for trunk/console
- Timestamp:
- 08/09/04 23:48:55 (4 years ago)
- Location:
- trunk/console/src
- Files:
-
- 6 modified
-
console.cpp (modified) (2 diffs)
-
console.h (modified) (1 diff)
-
console_menu.cpp (modified) (6 diffs)
-
console_print.cpp (modified) (3 diffs)
-
window.cpp (modified) (2 diffs)
-
window.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/console/src/console.cpp
r3768 r3801 2323 2323 winMain->wprintf("%C%AGranting authorizing to %s...", m_cColorInfo->nColor, 2324 2324 m_cColorInfo->nAttr, data->szId); 2325 winMain->event = licqDaemon-> icqAuthorizeGrant(strtoul(data->szId, (char **)NULL, 10), data->szMsg);2325 winMain->event = licqDaemon->ProtoAuthorizeGrant(data->szId, data->nPPID, data->szMsg); 2326 2326 } 2327 2327 else … … 2329 2329 winMain->wprintf("%C%ARefusing authorizing to %s...", m_cColorInfo->nColor, 2330 2330 m_cColorInfo->nAttr, data->szId); 2331 winMain->event = licqDaemon-> icqAuthorizeRefuse(strtoul(data->szId, (char **)NULL, 10), data->szMsg);2331 winMain->event = licqDaemon->ProtoAuthorizeRefuse(data->szId, data->nPPID, data->szMsg); 2332 2332 } 2333 2333 -
trunk/console/src/console.h
r3768 r3801 35 35 bool bOffline; 36 36 const struct SColorMap *color; 37 };38 39 struct SContact40 {41 char *szId;42 unsigned long nPPID;43 37 }; 44 38 -
trunk/console/src/console_menu.cpp
r3768 r3801 92 92 "a space. The command can be any valid command, do not\n" 93 93 "prepend the command character when defining.\n" 94 "Example: \"/define r last message\" creates a macro \"r\"\n"94 "Example: \"/define r message $\" creates a macro \"r\"\n" 95 95 "which replies to the last user you talked to."}, 96 96 { "help", &CLicqConsole::MenuHelp, NULL, … … 352 352 * CLicqConsole::MenuAuthorize 353 353 *-------------------------------------------------------------------------*/ 354 //TODO: update for other protocols355 354 void CLicqConsole::MenuAuthorize(char *szArg) 356 355 { 357 356 if (szArg == NULL) 358 357 { 359 winMain->wprintf("%CSpecify \"grant/refuse\" and a UIN to authorize.\n", COLOR_RED);358 winMain->wprintf("%CSpecify \"grant/refuse\" and a UIN/Screen Name to authorize.\n", COLOR_RED); 360 359 return; 361 360 } … … 372 371 bGrant = false; 373 372 szArg += 6; 374 }375 376 // Try to change groups377 int nUin = atol(szArg);378 379 if (nUin == 0)380 {381 winMain->wprintf("%CUIN must be non-zero.\n", COLOR_RED);382 return;383 373 } 384 374 … … 394 384 395 385 return; 396 397 398 386 } 399 387 … … 617 605 szCmd = strchr(szCmd, ' '); 618 606 } 619 //TODO - fix this 620 //else if (szArg[0] == '#') 621 //{ 622 // *p_szArg = NULL; 623 // return gUserManager.OwnerUin(); 624 //} 625 //else if (szArg[0] == '$') 626 //{ 627 // *p_szArg = NULL; 628 // return winMain->nLastUin; 629 //} 607 else if (szArg[0] == '#') 608 { 609 *p_szArg = NULL; 610 ICQOwner *o = gUserManager.FetchOwner(LOCK_R); 611 scon.szId = o->IdString(); 612 scon.nPPID = o->PPID(); 613 gUserManager.DropOwner(); 614 return scon; 615 } 616 else if (szArg[0] == '$') 617 { 618 *p_szArg = NULL; 619 return winMain->sLastContact; 620 } 630 621 else 631 622 { … … 659 650 } 660 651 661 //TODO662 652 // Save this as the last user 663 //if (winMain->nLastUin != nUin) 664 //{ 665 // winMain->nLastUin = nUin; 666 // PrintStatus(); 667 //} 653 if (winMain->sLastContact.szId == 0 || 654 !(strcmp(scon.szId, winMain->sLastContact.szId) == 0 && 655 scon.nPPID == winMain->sLastContact.nPPID)) 656 { 657 if (winMain->sLastContact.szId) 658 free(winMain->sLastContact.szId); 659 winMain->sLastContact.nPPID = scon.nPPID; 660 winMain->sLastContact.szId = strdup(scon.szId); 661 PrintStatus(); 662 } 668 663 669 664 return scon; -
trunk/console/src/console_print.cpp
r3768 r3801 141 141 strcpy(szMsgStr, "No Messages"); 142 142 143 if (winMain->nLastUin != 0) 144 { 145 ICQUser *u = gUserManager.FetchUser(winMain->nLastUin, LOCK_R); 143 if (winMain->sLastContact.szId != 0) 144 { 145 ICQUser *u = gUserManager.FetchUser(winMain->sLastContact.szId, 146 winMain->sLastContact.nPPID, LOCK_R); 146 147 if (u == NULL) 147 148 strcpy(szLastUser, "<Removed>"); … … 293 294 s->bOffline = pUser->StatusOffline(); 294 295 295 unsigned long iStatus = pUser->StatusFull();296 297 if( iStatus & ICQ_STATUS_FxPRIVATE)296 unsigned short nStatus = pUser->Status(); 297 298 if(pUser->StatusInvisible()) 298 299 { 299 300 szTmp = pUser->usprintf(m_szOtherOnlineFormat); … … 301 302 } 302 303 303 if((unsigned short)iStatus == ICQ_STATUS_OFFLINE)304 else if(nStatus == ICQ_STATUS_OFFLINE) 304 305 { 305 306 szTmp = pUser->usprintf(m_szOfflineFormat); 306 307 s->color = m_cColorOffline; 307 308 } 308 else if( (unsigned short) iStatus != ICQ_STATUS_OFFLINE && 309 ((iStatus & ICQ_STATUS_DND) || (iStatus & ICQ_STATUS_OCCUPIED) || 310 (iStatus & ICQ_STATUS_NA) || (iStatus & ICQ_STATUS_AWAY))) 309 else if(nStatus == ICQ_STATUS_DND || nStatus == ICQ_STATUS_OCCUPIED || 310 nStatus == ICQ_STATUS_NA || nStatus == ICQ_STATUS_AWAY) 311 311 { 312 312 szTmp = pUser->usprintf(m_szAwayFormat); 313 313 s->color = m_cColorAway; 314 314 } 315 else if( (unsigned short)iStatus == ICQ_STATUS_FREEFORCHAT)315 else if(nStatus == ICQ_STATUS_FREEFORCHAT) 316 316 { 317 317 szTmp = pUser->usprintf(m_szOtherOnlineFormat); 318 318 s->color = m_cColorOnline; 319 319 } 320 else if( (unsigned short)iStatus == ICQ_STATUS_ONLINE)320 else if(nStatus == ICQ_STATUS_ONLINE) 321 321 { 322 322 szTmp = pUser->usprintf(m_szOnlineFormat); -
trunk/console/src/window.cpp
r2721 r3801 67 67 wbkgd(win, COLOR_PAIR(COLOR_WHITE)); 68 68 nLastUin = 0; 69 sLastContact.szId = 0; 70 sLastContact.nPPID = 0; 69 71 nLastHistory = 1; 70 72 } … … 72 74 CWindow::~CWindow() 73 75 { 76 if (sLastContact.szId) 77 free(sLastContact.szId); 74 78 delwin(win); 75 79 } -
trunk/console/src/window.h
r3768 r3801 15 15 class CLicqConsole; 16 16 class CData; 17 18 struct SContact 19 { 20 char *szId; 21 unsigned long nPPID; 22 }; 23 17 24 18 25 class CWindow … … 43 50 CData *data; 44 51 unsigned long nLastUin; 45 //struct SContact sLastContact;52 struct SContact sLastContact; 46 53 unsigned short nLastHistory; 47 54 protected:
