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

const QString MsnObject::objectString (  )  const

Generates the string representation of the MsnObject. This is what we use when we actually want to send the object over the wire to a remote client.

Definition at line 252 of file msnobject.cpp.

Referenced by MsnObjectTransferP2P::contactStarted1_gotDisplayPictureRequest(), MsnObjectTransferP2P::contactStarted1_gotEmoticonRequest(), MsnObjectTransferP2P::showTransferComplete(), and MsnObjectTransferP2P::userStarted1_UserInvitesContact().

{
  if( ! original_.isEmpty() )
  {
    return original_;
  }

  QByteArray friendlyBase64;

  if( friendly_.length() == 0 )
  {
    friendlyBase64 = "AA==";  // null-terminator and padding.
  }
  else
  {
    // Copy existing UTF16 string to an QByteArray
    // remains valid until string is modified.
    const char *ucs2Data = reinterpret_cast<const char*>( friendly_.utf16() );
    friendlyBase64 = QByteArray( ucs2Data ).toBase64();
  }

  // Create msn object string.
  QString msnObjectString( "<msnobj Creator=\"" + creator_ +
                           "\" Size=\""     + QString::number( size_ ) +
                           "\" Type=\""     + QString::number( type_ ) +
                           "\" Location=\"" + location_ +
                           "\" Friendly=\"" + friendlyBase64 +
                           "\" SHA1D=\""    + sha1d_ +
                           "\" SHA1C=\""    + sha1c_ );

  // If the stamp isn't empty use it: it's not empty when we are creating msn object
  // for a wink, so the stamp is the certificate associated.
  if( ! stamp_.isEmpty() )
  {
    msnObjectString += "\" stamp=\"" + stamp_;
  }

  return msnObjectString + "\"/>";
}


Generated by  Doxygen 1.6.0   Back to index