Example #1
0
ICQEvent *ICQClient::searchByName(const char *first, const char *last, const char *nick, bool bOnline)
{
    if (!isLogged()) return 0;
    p->serverRequest(ICQ_SRVxREQ_MORE);
    p->sock->writeBuffer << ICQ_SRVxREQ_WP_SHORT;
    string sFirst = first ? first : "";
    string sLast = last ? last : "";
    string sNick = nick ? nick : "";
    log(L_DEBUG, "-- [%s] [%s] [%s]", first, last, nick);
    toServer(sFirst, owner);
    toServer(sLast, owner);
    toServer(sNick, owner);
    p->sock->writeBuffer
    << sNick
    << sFirst
    << sNick;
    if (bOnline){
        p->sock->writeBuffer
        << 0x30020100L
        << (char)0x01;
    }
    p->sendServerRequest();
    ICQEvent *e = new SearchEvent(p->m_nMsgSequence);
    p->varEvents.push_back(e);
    return e;
}
Example #2
0
 ErrorType UccSession::sendSync (IMessageType const & messageRq, IMessageType & messageRs, TimeMillisecondsType timeout)
 {
   if (isLogged())
   {
     ScopedLock guard(m_mtxUcc);
     return setError(AbsSessionType::sendSync(messageRq, messageRs, timeout));
   }
   else
   {
     return setError(UccSession::UccSessionError::CErrorNoUccSessionAvailable);
   }
 }
Example #3
0
 ErrorType UccSession::send (IMessageType const & messageRq)
 {
   if (isLogged())
   {
     ScopedLock guard(m_mtxUcc);
     return setError(AbsSessionType::send(messageRq));
   }
   else
   {
     return setError(UccSession::UccSessionError::CErrorNoUccSessionAvailable);
   }
 }
Example #4
0
void ICQClient::setPassword(const char *passwd)
{
    if (!isLogged()) return;
    p->serverRequest(ICQ_SRVxREQ_MORE);
    p->sock->writeBuffer << ICQ_SRVxREQ_CHANGE_PASSWD;
    string pass = passwd;
    toServer(pass, owner);
    p->sock->writeBuffer << pass;
    p->sendServerRequest();
    SetPasswordEvent *e = new SetPasswordEvent(p->m_nMsgSequence, passwd);
    p->varEvents.push_back(e);
}
Example #5
0
ICQEvent *ICQClient::searchByUin(unsigned long uin)
{
    if (!isLogged()) return 0;
    p->serverRequest(ICQ_SRVxREQ_MORE);
    p->sock->writeBuffer
    << ICQ_SRVxREQ_WP_INFO_UIN
    << 0x36010400L;
    p->sock->writeBuffer.pack(uin);
    p->sendServerRequest();
    ICQEvent *e = new SearchEvent(p->m_nMsgSequence);
    p->varEvents.push_back(e);
    return e;
}
Example #6
0
void ICQClient::setSecurityInfo(bool bAuthorize, bool bWebAware)
{
    if (!isLogged()) return;
    p->serverRequest(ICQ_SRVxREQ_MORE);
    p->sock->writeBuffer
    << ICQ_SRVxREQ_PERMISSIONS
    << (char)(bAuthorize ? 0 : 0x01)
    << (char)(bWebAware ? 0x01 : 0)
    << (char)0x02
    << (char)0;
    p->sendServerRequest();
    SetSecurityInfo *e = new SetSecurityInfo(p->m_nMsgSequence, bAuthorize, bWebAware);
    p->varEvents.push_back(e);
}
Example #7
0
ICQEvent *ICQClient::searchWP(const char *szFirst, const char *szLast, const char *szNick,
                              const char *szEmail, char age, char nGender,
                              char nLanguage, const char *szCity, const char *szState,
                              unsigned short nCountryCode,
                              const char *szCoName, const char *szCoDept, const char *szCoPos,
                              char nOccupation,
                              unsigned short nPast, const char *szPast,
                              unsigned short nInterests, const char *szInterests,
                              unsigned short nAffiliation, const char *szAffiliation,
                              unsigned short nHomePage, const char *szHomePage,
                              bool bOnlineOnly)
{
    if (!isLogged()) return 0;
    p->serverRequest(ICQ_SRVxREQ_MORE);
    p->sock->writeBuffer << ICQ_SRVxREQ_WP_FULL;
    string sFirst = szFirst ? szFirst : "";
    string sLast = szLast ? szLast : "";
    string sNick = szNick ? szNick : "";
    string sEmail = szEmail ? szEmail : "";
    string sCity = szCity ? szCity : "";
    string sState = szState ? szState : "";
    string sCoName = szCoName ? szCoName : "";
    string sCoDept = szCoDept ? szCoDept : "";
    string sCoPos = szCoPos ? szCoPos : "";
    string sPast = szPast ? szPast : "";
    string sInterests = szInterests ? szInterests : "";
    string sAffiliation = szAffiliation ? szAffiliation : "";
    string sHomePage = szHomePage ? szHomePage : "";

    toServer(sFirst, owner);
    toServer(sLast, owner);
    toServer(sNick, owner);
    toServer(sEmail, owner);
    toServer(sCity, owner);
    toServer(sState, owner);
    toServer(sCoName, owner);
    toServer(sCoDept, owner);
    toServer(sCoPos, owner);
    toServer(sPast, owner);
    toServer(sInterests, owner);
    toServer(sAffiliation, owner);
    toServer(sHomePage, owner);

    unsigned short nMinAge = 0;
    unsigned short nMaxAge = 0;
    switch (age){
    case 1:
        nMinAge = 18;
        nMaxAge = 22;
        break;
    case 2:
        nMinAge = 23;
        nMaxAge = 29;
        break;
    case 3:
        nMinAge = 30;
        nMaxAge = 39;
        break;
    case 4:
        nMinAge = 40;
        nMaxAge = 49;
        break;
    case 5:
        nMinAge = 50;
        nMaxAge = 59;
        break;
    case 6:
        nMinAge = 60;
        nMaxAge = 120;
        break;
    }

    p->sock->writeBuffer
    << sFirst
    << sLast
    << sNick
    << sEmail;
    p->sock->writeBuffer.pack(nMinAge);
    p->sock->writeBuffer.pack(nMaxAge);
    p->sock->writeBuffer
    << nGender
    << nLanguage
    << sCity
    << sState;
    p->sock->writeBuffer.pack(nCountryCode);
    p->sock->writeBuffer
    << sCoName
    << sCoDept
    << sCoPos

    << nOccupation
    << nPast
    << sPast
    << nInterests
    << sInterests
    << nAffiliation
    << sAffiliation
    << nHomePage
    << sHomePage;

    char c = bOnlineOnly ? 1 : 0;
    p->sock->writeBuffer << c;

    p->sendServerRequest();

    ICQEvent *e = new SearchEvent(p->m_nMsgSequence);
    p->varEvents.push_back(e);
    return e;
}