Logo Search packages:      
Sourcecode: nateon version File versions  Download package

void KNateon::slotMajorHompy ( const QString &  sResult  )  [private, slot]

미니홈피 주계정 정보 가져 오기

C1, C2 주계정 정보 가져 오기.

TODO: MajorHompy nateon: C1C2 Result : [ERROR
12737092:a0552737:2
] nateon: [ERROR] nateon: [12737092:a0552737:2] 결과가 이상한것 같음 확인 필요.

새글 정보 가져 오기

본인의 싸이아이디가 버디리스트에 등록이 되있는 경우 CyCMN이 2개 나옴.

Definition at line 5817 of file knateon.cpp.

References BuddyList::getBuddyByCyworldCMN(), CurrentAccount::getBuddyList(), BuddyBase::getCyworld_CMN(), BuddyBase::getHompyType(), CurrentAccount::getHompyType(), BuddyBase::getMajorCMN(), CurrentAccount::getMyCyworldCMN(), CurrentAccount::getMyMajorCMN(), CurrentAccount::getMyTicket(), nmconfig::logintype, BuddyBase::setHome2CMN(), BuddyBase::setHompyType(), CurrentAccount::setHompyType(), BuddyBase::setMajorCMN(), CurrentAccount::setMyHome2CMN(), CurrentAccount::setMyMajorCMN(), slotHompyNew(), and nmconfig::usecyworld.

Referenced by slotC1C2().

{
      /*!
       * TODO: MajorHompy
       * nateon: C1C2 Result : [ERROR<BR>12737092:a0552737:2<BR>]
       * nateon: [ERROR]
       * nateon: [12737092:a0552737:2]
       * 결과가 이상한것 같음 확인 필요.
       */

#ifdef NETDEBUG
      kdDebug() << "C1C2 Result : [" << sResult << "]" << endl;
#endif
      QStringList slC2 = QStringList::split( "<BR>", sResult );

#ifdef NETDEBUG
      for ( QStringList::Iterator it = slC2.begin(); it != slC2.end(); ++it )
      {
            kdDebug() << "[" << *it << "]" << endl;
      }
#endif

      if ( slC2[0] != "ERROR" )
      {
#ifdef NETDEBUG
            kdDebug() << "현재 사용자의 Cyworld 연동 정보 : " << slC2[0] << endl;
#endif
            QStringList slInfo = QStringList::split( ":", slC2[0] );
            if ( slInfo[2] == "2" )
            {
                  m_pCurrentAccount->setHompyType( CurrentAccount::Home2 );
                  m_pCurrentAccount->setMyHome2CMN( slInfo[1] );
            }
            else
            {
                  m_pCurrentAccount->setHompyType( CurrentAccount::Cyworld );
            }
            m_pCurrentAccount->setMyMajorCMN( slInfo[1] );
      }
#ifdef NETDEBUG
      else
      {
            kdDebug() << "현재 사용자는 Cyworld 연동을 하지 않고 있습니다." << endl;
      }
#endif

      int i=0;
      for ( QStringList::Iterator it = slC2.begin(); it != slC2.end(); ++it )
      {
            if ( i == 0 )
            {
                  i++;
                  continue;
            }

            QStringList slInfo = QStringList::split( ":", *it );
            m_pBuddyList = m_pCurrentAccount->getBuddyList();
            Buddy* pBuddy = m_pBuddyList->getBuddyByCyworldCMN( slInfo[0] );
            if ( pBuddy )
            {
                  if ( slInfo[2] == "2" )
                  {
                        pBuddy->setHompyType( Buddy::Home2 );
                        pBuddy->setHome2CMN( slInfo[1] );
                  }
                  else
                  {
                        pBuddy->setHompyType( Buddy::Cyworld );
                  }
                  pBuddy->setMajorCMN( slInfo[1] );
            }
      }
      
      if ( ( ( stConfig.logintype == 'N' ) && stConfig.usecyworld ) || ( stConfig.logintype == 'C' ) )
      {
            /*! 새글 정보 가져 오기 */
            if ( !pHompyNewCGI )
            {
                  pHompyNewCGI = new PostCGI();
                  connect(pHompyNewCGI, SIGNAL( gotResult( const QString& ) ), SLOT( slotHompyNew( const QString& ) ) );
            }
            
            QString sURL("http://www.cyworld.com/pims/nateon/nateon_new_article_c2_ticket.asp");
            QString sParam("param=");
            sParam += m_pCurrentAccount->getMyCyworldCMN();
            sParam += "%3a";
            sParam += m_pCurrentAccount->getMyMajorCMN();
            sParam += "%3a";
            if ( m_pCurrentAccount->getHompyType() == CurrentAccount::Home2 )
                  sParam += "2";
            else
                  sParam += "1";
            sParam += "&ticket=";
            sParam += m_pCurrentAccount->getMyTicket();
            sParam += "&buddy_list=";
            BuddyList* p_BuddyList = m_pCurrentAccount->getBuddyList();
            QPtrListIterator<Buddy> iterator( *p_BuddyList );
            QString sCMN;
            QString sCMNList;
            while(iterator.current() != 0)
            {
                  Buddy *pBuddy = iterator.current();
                  sCMN = pBuddy->getCyworld_CMN();
                  if ( sCMN.length() > 0 )
                  {
                /*!
                 * 본인의 싸이아이디가 버디리스트에 등록이 되있는 경우
                 * CyCMN이 2개 나옴.
                 */
                        if ( sCMN.data()[0] != '%' )
                        {
                              if ( sCMNList.length() > 0 )
                              {
                                    sCMNList += "%3b";
                              }
                              sCMNList += sCMN;
                              sCMNList += "%3a";
                              sCMNList += pBuddy->getMajorCMN();
                              sCMNList += "%3a";
                              if ( pBuddy->getHompyType() == Buddy::Home2 )
                                    sCMNList += "2";
                              else
                                    sCMNList += "1";
                        }
                  }
                  ++iterator;
            }
            sParam += sCMNList;
#ifdef NETDEBUG
            kdDebug() << "Post Param : [" << sParam << "]" << endl;
#endif
            pHompyNewCGI->start( sURL, sParam );
      }
}


Generated by  Doxygen 1.6.0   Back to index