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

void MsnSwitchboardConnection::parseError ( const QStringList &  command,
const QByteArray &  payloadData 
) [private, virtual]

Process a received error command.

An incoming error command may look like:

205 12 65
<ml><d n="microsoft.com"><c n="messenger" t="1" l="4" /></d></ml>

or like:

207 12

The first kind has a payload, the second does not. The additional command parameter reveals that there's a payload. We need to be able to parse both kinds, and report the additional data to the user if any is present.

The meaning of error codes can be looked up on MSNPiki: http://msnpiki.msnfanatic.com/index.php/Reference:Error_List but please note that at the moment of writing, it's outdated: it is not mentioned there that even errors may contain payload data.

Parameters:
command The received error and it's arguments.
payloadData The message payload which followed the command, if any.

Reimplemented from MsnConnection.

Definition at line 1241 of file msnswitchboardconnection.cpp.

References MsnConnection::parseError().

{
  // TODO: Check if any payload is delivered for these errors: it may contain
  // info about the error. For 215 it may specify which contact was invited
  // twice.
  if ( command[0] == "215" )
  {
    kWarning() << "A contact was invited twice!";
  }
  else if ( command[0] == "712" )
  {
    kWarning() << "The SB session is overloaded.";
  }
  else if( command[0] == "216" || command[0] == "217" )
  {
    // The contact is invisible now, send Offline IMs
    if( backgroundConnection_ )
    {
#ifdef KMESSDEBUG_SWITCHBOARD_GENERAL
      kDebug() << "Ignoring a 'contact is offline/invisible' error in background chats.";
#endif
      return;
    }

    // CAL invite failed.
    // Make sure sendMimeMessageWhenReady() does not hang on this state.
    if( connectionState_ == SB_INVITING_CONTACTS && contactsInChat_.isEmpty() )
    {
      connectionState_ = SB_CONTACTS_LEFT;
    }
  }
  else if ( command[0] == "282" )
  {
    // Got it once when I sent a bad P2P message or something.
    kWarning() << "got the mysterious 282 error response (contacts=" << contactsInChat_ << ").";
  }
  else if ( command[0] == "911" )
  {
    kDebug() << "authentication failed.";
  }
  else
  {
    // Relay the error detection to the base class
    MsnConnection::parseError( command, payloadData );
  }
}


Generated by  Doxygen 1.6.0   Back to index