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

OfflineImService * MsnNotificationConnection::createOfflineImService (  )  [private]

Internal function to create the Offline-IM service.

This service is used to retrieve the Offline-IM messages. The signals are attached to receivedOfflineIm() and receivedMailData()

Returns:
The Offline-IM webservice handler

Definition at line 696 of file msnnotificationconnection.cpp.

References MsnConnection::addSoapClient(), and CurrentAccount::getToken().

Referenced by parseMimeMessage().

{
  // Extract the 't' and 'p' values from the current authentication ticket string
  // This is done beacuse sendMessage() could has requested one new ticket
  const QStringList& fields( currentAccount_->getToken( "Messenger" ).split("&") );
  QString authT, authP;

  foreach( const QString &field, fields )
  {
    if( field.startsWith("t=") )
    {
      authT = field.mid(2);
    }
    else if( field.startsWith("p=") )
    {
      authP = field.mid(2);
    }
#ifdef KMESSDEBUG_NOTIFICATION
    else
    {
      kWarning() << "Could not parse authentication field:" << field;
    }
#endif
  }

  // Request the first offline-im message
  // TODO reuse the pointer, and set the token like addressbook
  OfflineImService *oimService = new OfflineImService( authT, authP, this );

  // Add the soap client.
  addSoapClient( oimService );

  // Register signals
  connect( oimService, SIGNAL(   messageReceived( const QString&,   const QString&, const QString&,
           const QDateTime&, const QString&, const QString&, int ) ),
           this,       SLOT  ( receivedOfflineIm( const QString&,   const QString&, const QString&,
                               const QDateTime&, const QString&, const QString&, int ) ));
  connect( oimService, SIGNAL( metaDataReceived( QDomElement ) ),
           this,       SLOT  ( receivedMailData( QDomElement ) ));

  return oimService;
}


Generated by  Doxygen 1.6.0   Back to index