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

void KNateon::slotGotINFY ( const QStringList &  slCommand  )  [private, slot]

NTFY 0 ring0320@nate.com O 0 00 1

친구 로그인 소리

0: Online, 1: incoming chat, 2: incoming memo

Definition at line 2874 of file knateon.cpp.

References nmconfig::alarmbuddyconnect, nmconfig::buddyconnectsoundpath, Common::fixOutString(), BuddyList::getBuddyByID(), CurrentAccount::getBuddyList(), ChatList::getChatList(), BuddyBase::getName(), BuddyBase::getNick(), BuddyBase::getStatus(), BuddyBase::getUID(), m_pChatList, slotClickChatPopup(), KNateonMainview::slotGotINFY(), sPicsPath, nmconfig::usebuddyconnectsound, and nmconfig::usesound.

Referenced by connected().

{
      if (slCommand[0] == "NTFY")
      {
            m_pBuddyList = m_pCurrentAccount->getBuddyList();
            if ( !m_pBuddyList )
                  return;

            Buddy *pBuddy = m_pBuddyList->getBuddyByID(slCommand[2]);
            if ( !pBuddy )
                  return;
            
            if ( pBuddy->getStatus() == "F" )
            {
                  if (systemTrayWidget_ != 0)
                  {
                        /*!
                         * 친구 로그인 소리
                         */
                        if ( stConfig.usesound && stConfig.usebuddyconnectsound )
                              Sound::play( stConfig.buddyconnectsoundpath );

                        if ( stConfig.alarmbuddyconnect )
                        {
                              if ( !pPopup )
                              {
                                    pPopup = new PopupWindow();
                                    connect(pPopup, SIGNAL( clickText( int, QString ) ), this, SLOT(slotClickChatPopup(int, QString ) ) );
                                    connect( pPopup, SIGNAL( hidePopup() ), SLOT( slotHidePopup() ) );
                              }

                              QPoint point = systemTrayWidget_->mapToGlobal( systemTrayWidget_->pos() );

                              int screen = kapp->desktop()->screenNumber();
                              QRect screenSize = kapp->desktop()->availableGeometry(screen);
                              
                              int nX = point.x();
                              int nY = screenSize.height() + screenSize.top();
                              // kdDebug() << "AH : [" << screenSize.height() << "]" << endl;
                              
                              pPopup->setAnchor( QPoint(nX, nY) );
                              pPopup->setLogo( sPicsPath + "slidewnd_login.bmp" , 16777215);

                              QString sNickTemp;
                              if ( pBuddy->getNick() == "%00" )
                                    sNickTemp = pBuddy->getName();
                              else
                                    sNickTemp = pBuddy->getNick();
                              
                              int nNameLen = pBuddy->getName().length();
                              int nNickLen = sNickTemp.length();
                              int nAllLen = nNameLen + nNickLen;

                              QString sMsg;
                              sMsg = pBuddy->getName();
                              sMsg += "(";
                              QString sNick;
                              if ( nAllLen  > 36 )
                              {
                                    int nOver = nAllLen - 36;
                                    int nNickFixLen = nNickLen - ( nOver + 3 );
                                    sNick = sNickTemp.left( nNickFixLen );
                                    sNick += "...";
                              }
                              else
                              {
                                    sNick = sNickTemp;
                              }
#ifdef NETDEBUG
                              kdDebug() << "Nick : [" << sNick << "]" << endl;
#endif
                              Common::fixOutString( sNick );
#ifdef NETDEBUG
                              kdDebug() << "Nick : [" << sNick << "]" << endl;
#endif
                              sMsg += sNick;
                              sMsg += UTF8( ") 님이 로그인 하셨습니다." );

                              pPopup->setText( sMsg );

                              /*! 0: Online, 1: incoming chat, 2: incoming memo */
                              pPopup->setType(0);
                              pPopup->setID( pBuddy->getUID() );
                              pPopup->show();
                              nPopupY++;
                        }
                  }
            }
      }

      m_pMainView->slotGotINFY( slCommand );
      
      QPtrList<ChatView> m_ChatObjs = m_pChatList->getChatList();
      QPtrListIterator<ChatView> iterator(m_ChatObjs);
      
      while(iterator.current() != 0)
      {
            ChatView* pChatView = iterator.current();
            if ( pChatView->getBuddyByID( slCommand[2] ) )
            {
                  pChatView->updateUserStatus(slCommand[2], slCommand[3]);
            }
            ++iterator;
      }
}


Generated by  Doxygen 1.6.0   Back to index