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

void AddressBookService::contactUpdate ( ContactProperty  property,
const QString &  newValue 
)

Put the Soap action to update the information about contact.

Parameters:
property the property that has changed (see ContactProperty in addressbookservice.h)
newValue the new value for that property.

Definition at line 254 of file addressbookservice.cpp.

References createCommonHeader(), KMessShared::htmlEscape(), and PassportLoginService::sendSecureRequest().

Referenced by MsnNotificationConnection::changeFriendlyName().

{
  QString propertyString;
  QString propertiesChanged;

  switch( property )
  {
    case PROPERTY_FRIENDLYNAME:
      propertyString = "        <displayName>" + KMessShared::htmlEscape( newValue ) + "</displayName>\n";
      propertiesChanged = "DisplayName";
      break;

    case PROPERTY_PRIVACY:
      propertyString = (  "        <annotations>\n"
                          "         <Annotation>\n"
                          "           <Name>MSN.IM.BLP</Name>\n"
                          "           <Value>" + newValue + "</Value>\n"
                          "         </Annotation>\n"
                          "        </annotations>\n");
      propertiesChanged = "Annotation";
      break;

    default:
      return;
  }

  QString body( "<ABContactUpdate xmlns=\"http://www.msn.com/webservices/AddressBook\">\n"
                "  <abId>00000000-0000-0000-0000-000000000000</abId>\n"
                "  <contacts>\n"
                "    <Contact xmlns=\"http://www.msn.com/webservices/AddressBook\">\n"
                "      <contactInfo>\n"
                "        <contactType>Me</contactType>\n"
                        + propertyString +
                "      </contactInfo>\n"
                "      <propertiesChanged>" + propertiesChanged + "</propertiesChanged>\n"
                "    </Contact>\n"
                "  </contacts>\n"
                "</ABContactUpdate>" );

  sendSecureRequest( new SoapMessage( SERVICE_URL_ADDRESSBOOK,
                                      "http://www.msn.com/webservices/AddressBook/ABContactUpdate",
                                      createCommonHeader( "Timer" ),
                                      body ),
                     "Contacts" );
}


Generated by  Doxygen 1.6.0   Back to index