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

void MsnNotificationConnection::gotNln ( const QStringList &  command  )  [private]

Handle the NLN command; a contact changed it's status.

When a user updates it's status with the CHG command, all it's contact receive a NLN command. KMess sends the CHG command with the changeStatus() method. The CHG allows a contact to change it's name, client capabilities or MsnObject.

The capabilities are a bitwise flag. The list of known values are described in the ContactBase::MsnClientCapabilities enum.

The MsnObject is an identifier for the display picture. To download the actual picture, a client needs to initiate a chat, and send an invitation there.

<<< NLN NLN user@kmessdemo.org KMess%20Demo 1342210080 %3Cmsnobj%20Creator%3D%22user%40kmessdemo.org%22%20Size%3D%2211581%22%20Type%3D%223%22%20Location%3D%22KMess.tmp%22%20Friendly%3D%22AA%3D%3D%22%20SHA1D%3D%223VfOMCTTkuYHDjJhPx4sSlPiM%2Bs%3D%22%20SHA1C%3D%22ULeT2WGsdabLGNP3RgbWYw7ve80%3D%22/%3E

Parameters:
command The command arguments.
  • command[1] is the status code, see changeStatus()
  • command[2] is the contact handle.
  • command[3] networkid.
  • command[4] is the contact name, url encoded.
  • command[5] is the client-capabilities flag.
  • command[6] is the url-encoded MsnObject XML code.

Definition at line 1092 of file msnnotificationconnection.cpp.

References ContactList::changeContactStatus(), MsnStatus::codeToStatus(), and MsnStatus::getCode().

Referenced by parseCommand().

{
  if(KMESS_NULL(contactList_)) return;

  // Get the contact info from the message
  const QString& handle       ( command[2].toLower() );
  const QString& friendlyName ( QUrl::fromPercentEncoding( command[4].toUtf8() ) );
        QString  msnObject    ( QUrl::fromPercentEncoding( command[6].toUtf8() ) );

  Status status        = MsnStatus::codeToStatus( command[1] );
  uint   capabilities  = command[5].toUInt();

  // Check if the contact removes his picture
  if( msnObject == "0" )
  {
    msnObject = "";
  }

#ifdef KMESSDEBUG_NOTIFICATION_GENERAL
  kDebug() << handle << " is now " << MsnStatus::getCode( status ) << ".";
#endif

  // Update contact status.
  contactList_->changeContactStatus( handle, status, friendlyName, capabilities, msnObject, enableNotifications_ );
}


Generated by  Doxygen 1.6.0   Back to index