Changeset 6433 for trunk/qt4-gui/src

Show
Ignore:
Timestamp:
07/09/08 03:03:38 (5 months ago)
Author:
eugene
Message:

Added the way to view user info upon receiving Auth Request, Auth Granted, and Added to List notice.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/userevents/userviewevent.cpp

    r6429 r6433  
    577577      LicqGui::instance()->viewUrl(dynamic_cast<CEventUrl*>(myCurrentEvent)->Url()); 
    578578      break; 
     579 
     580    case ICQ_CMDxSUB_AUTHxREQUEST: // Fall through 
     581    case ICQ_CMDxSUB_AUTHxGRANTED: 
     582    case ICQ_CMDxSUB_ADDEDxTOxLIST: 
     583    { 
     584      const char* id; 
     585      unsigned long ppid; 
     586#define GETINFO(sub, type) \ 
     587      if (myCurrentEvent->SubCommand() == sub) \ 
     588      { \ 
     589        type* p = dynamic_cast<type*>(myCurrentEvent); \ 
     590        id = p->IdString(); \ 
     591        ppid = p->PPID(); \ 
     592      } 
     593 
     594      GETINFO(ICQ_CMDxSUB_AUTHxREQUEST, CEventAuthRequest); 
     595      GETINFO(ICQ_CMDxSUB_AUTHxGRANTED, CEventAuthGranted); 
     596      GETINFO(ICQ_CMDxSUB_ADDEDxTOxLIST, CEventAdded); 
     597#undef GETINFO 
     598 
     599      ICQUser* u = gUserManager.FetchUser(id, ppid, LOCK_R); 
     600      if (u == NULL) 
     601        gLicqDaemon->AddUserToList(id, ppid, false, true); 
     602      else 
     603        gUserManager.DropUser(u); 
     604 
     605      LicqGui::instance()->showInfoDialog(mnuUserGeneral, id, ppid, false, true); 
     606      break; 
     607    } 
    579608  } // switch 
    580609} 
     
    713742        else 
    714743          gUserManager.DropUser(u); 
     744        myRead4Button->setText(tr("&View Info")); 
    715745        break; 
    716746      } 
     
    724754        else 
    725755          gUserManager.DropUser(u); 
     756        myRead4Button->setText(tr("&View Info")); 
    726757        break; 
    727758      } 
     
    735766        else 
    736767          gUserManager.DropUser(u); 
     768        myRead4Button->setText(tr("&View Info")); 
    737769        break; 
    738770      }