Removed __declspec from msn and yahoo plugins, updated libmsn to the latest version

This commit is contained in:
barrett 2012-02-26 03:35:45 +00:00
parent 1930170620
commit d86051bdfe
23 changed files with 195 additions and 317 deletions

View File

@ -24,5 +24,5 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "authdata.h" #include <authdata.h>

View File

@ -26,7 +26,7 @@
*/ */
#include <string> #include <string>
#include "passport.h" #include <passport.h>
#include "libmsn_export.h" #include "libmsn_export.h"

View File

@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "buddy.h" #include <buddy.h>
#include <cassert> #include <cassert>
namespace MSN namespace MSN

View File

@ -29,7 +29,7 @@
#include <list> #include <list>
#include <vector> #include <vector>
#include <map> #include <map>
#include "passport.h" #include <passport.h>
#include "libmsn_export.h" #include "libmsn_export.h"

View File

@ -22,12 +22,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "connection.h" #include <connection.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "util.h" #include <util.h>
#include "passport.h" #include <passport.h>
#include "externals.h" #include <externals.h>
#include "notificationserver.h" #include <notificationserver.h>
#ifndef WIN32 #ifndef WIN32
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>

View File

@ -29,7 +29,6 @@
#include <vector> #include <vector>
#include <map> #include <map>
#include <stdexcept> #include <stdexcept>
#include <sstream>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning( disable : 4290 ) #pragma warning( disable : 4290 )

View File

@ -27,7 +27,7 @@
#include <string> #include <string>
#include <list> #include <list>
#include "switchboardserver.h" #include <switchboardserver.h>
#include "libmsn_export.h" #include "libmsn_export.h"

View File

@ -25,9 +25,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h" #include <config.h>
#include "buddy.h" #include <buddy.h>
#include "util.h" #include <util.h>
#include "libmsn_export.h" #include "libmsn_export.h"

View File

@ -23,9 +23,9 @@
*/ */
#include <stdlib.h> #include <stdlib.h>
#include "message.h" #include <message.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "util.h" #include <util.h>
#include <iomanip> #include <iomanip>
#include <cassert> #include <cassert>
@ -124,7 +124,7 @@ namespace MSN
{ {
std::string color = this->getFormatInfo()["CO"]; std::string color = this->getFormatInfo()["CO"];
assert(color.size() <= 6 && color.size() >= 0); assert(color.size() <= 6 && color.size() >= 0);
color.insert(0UL, 6 - color.size(), '0'); color.insert(0U, 6 - color.size(), '0');
int r = 0, g = 0, b = 0; int r = 0, g = 0, b = 0;
b = strtol(color.substr(0, 2).c_str(), NULL, 16); b = strtol(color.substr(0, 2).c_str(), NULL, 16);
@ -167,7 +167,7 @@ namespace MSN
void Message::setColor(std::string color) void Message::setColor(std::string color)
{ {
color.insert(0UL, 6 - color.size(), '0'); color.insert(0U, 6 - color.size(), '0');
int r = 0, g = 0, b = 0; int r = 0, g = 0, b = 0;
r = strtol(color.substr(0, 2).c_str(), NULL, 16); r = strtol(color.substr(0, 2).c_str(), NULL, 16);

View File

@ -25,14 +25,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "authdata.h" #include <authdata.h>
#include "connection.h" #include <connection.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "externals.h" #include <externals.h>
#include "message.h" #include <message.h>
#include "notificationserver.h" #include <notificationserver.h>
#include "switchboardserver.h" #include <switchboardserver.h>
#include "util.h" #include <util.h>
#include "soap.h" #include <soap.h>
#endif #endif

View File

@ -19,10 +19,10 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "util.h" #include <util.h>
#include <openssl/sha.h> #include <openssl/sha.h>
#include "msnobject.h" #include <msnobject.h>
#include "xmlParser.h" #include <xmlParser.h>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>

View File

@ -22,13 +22,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h" #include <config.h>
#include "notificationserver.h" #include <notificationserver.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "externals.h" #include <externals.h>
#include "md5.h" #include <md5.h>
#include "util.h" #include <util.h>
#include "soap.h" #include <soap.h>
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
#include <cassert> #include <cassert>

View File

@ -25,15 +25,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "connection.h" #include <connection.h>
#include "authdata.h" #include <authdata.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "buddy.h" #include <buddy.h>
#include "passport.h" #include <passport.h>
#include <stdexcept> #include <stdexcept>
#include "externals.h" #include <externals.h>
#include "msnobject.h" #include <msnobject.h>
#include "soap.h" #include <soap.h>
#include <cassert> #include <cassert>
#include <sys/types.h> #include <sys/types.h>

View File

@ -20,12 +20,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "notificationserver.h" #include <notificationserver.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "externals.h" #include <externals.h>
#include "util.h" #include <util.h>
#include "p2p.h" #include <p2p.h>
#include "xmlParser.h" #include <xmlParser.h>
#include <cctype> #include <cctype>
#include <iostream> #include <iostream>

View File

@ -23,12 +23,12 @@
*/ */
#include "connection.h" #include <connection.h>
#include "authdata.h" #include <authdata.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "buddy.h" #include <buddy.h>
#include "passport.h" #include <passport.h>
#include "util.h" #include <util.h>
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>

View File

@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "passport.h" #include <passport.h>
#include <stdio.h> #include <stdio.h>
namespace MSN namespace MSN

View File

@ -22,12 +22,12 @@
#include "notificationserver.h" #include <notificationserver.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "externals.h" #include <externals.h>
#include "md5.h" #include <md5.h>
#include "util.h" #include <util.h>
#include "soap.h" #include <soap.h>
#include <cctype> #include <cctype>
#include <iostream> #include <iostream>
@ -314,25 +314,17 @@ namespace MSN {
void Soap::parseGetTicketsResponse(std::string response) void Soap::parseGetTicketsResponse(std::string response)
{ {
XMLNode domTree = XMLNode::parseString( response.c_str() ); XMLNode response1 = XMLNode::parseString( response.c_str() );
if(http_response_code == "301" ) if(http_response_code == "301")
{ {
const char *preferredHostName = domTree.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, AUTH);
if(preferredHostName) soapConnection->getTickets(this->passport, this->password, this->policy);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[AUTH] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->getTickets(this->passport, this->password, this->policy);
}
return; return;
} }
// get the header information from the DOM // get the header information from the DOM
XMLNode tokens = domTree.getChildNode("S:Envelope").getChildNode("S:Body").getChildNode("wst:RequestSecurityTokenResponseCollection"); XMLNode tokens = response1.getChildNode("S:Envelope").getChildNode("S:Body").getChildNode("wst:RequestSecurityTokenResponseCollection");
const char *reason = domTree.getChildNode("S:Envelope").getChildNode("S:Fault").getChildNode("faultcode").getText(); const char *reason = response1.getChildNode("S:Envelope").getChildNode("S:Fault").getChildNode("faultcode").getText();
if(reason) if(reason)
{ {
std::string reason1(reason); std::string reason1(reason);
@ -345,7 +337,7 @@ namespace MSN {
} }
if(reason1 == "psf:Redirect") if(reason1 == "psf:Redirect")
{ {
const char *newurl = domTree.getChildNode("S:Envelope").getChildNode("S:Fault").getChildNode("psf:redirectUrl").getText(); const char *newurl = response1.getChildNode("S:Envelope").getChildNode("S:Fault").getChildNode("psf:redirectUrl").getText();
Soap *soapConnection = new Soap(notificationServer); Soap *soapConnection = new Soap(notificationServer);
std::string newurl1(newurl); std::string newurl1(newurl);
@ -480,22 +472,14 @@ namespace MSN {
void Soap::parseEnableContactOnAddressBookResponse(std::string response) void Soap::parseEnableContactOnAddressBookResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, ENABLE_CONTACT_ON_ADDRESSBOOK);
if(preferredHostName) soapConnection->enableContactOnAddressBook(this->contactId, this->tempPassport, this->myDisplayName);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[ENABLE_CONTACT_ON_ADDRESSBOOK] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->enableContactOnAddressBook(this->contactId, this->tempPassport, this->myDisplayName);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -576,22 +560,14 @@ namespace MSN {
void Soap::parseDelContactFromAddressBookResponse(std::string response) void Soap::parseDelContactFromAddressBookResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, DEL_CONTACT_FROM_ADDRESSBOOK);
if(preferredHostName) soapConnection->delContactFromAddressBook(this->contactId, this->tempPassport);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[DEL_CONTACT_FROM_ADDRESSBOOK] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->delContactFromAddressBook(this->contactId, this->tempPassport);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -683,22 +659,14 @@ namespace MSN {
void Soap::parseDisableContactFromAddressBookResponse(std::string response) void Soap::parseDisableContactFromAddressBookResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, DISABLE_CONTACT_ON_ADDRESSBOOK);
if(preferredHostName) soapConnection->disableContactFromAddressBook(this->contactId, this->tempPassport);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[DISABLE_CONTACT_ON_ADDRESSBOOK] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->disableContactFromAddressBook(this->contactId, this->tempPassport);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -797,18 +765,11 @@ namespace MSN {
void Soap::parseAddContactToAddressBookResponse(std::string response) void Soap::parseAddContactToAddressBookResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, ADD_CONTACT_TO_ADDRESSBOOK);
if(preferredHostName) soapConnection->addContactToAddressBook(this->tempPassport, this->tempDisplayName);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[ADD_CONTACT_TO_ADDRESSBOOK] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->addContactToAddressBook(this->tempPassport, this->tempDisplayName);
}
return; return;
} }
@ -902,22 +863,14 @@ namespace MSN {
void Soap::parseAddContactToGroupResponse(std::string response) void Soap::parseAddContactToGroupResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, ADD_CONTACT_TO_GROUP);
if(preferredHostName) soapConnection->addContactToGroup(this->groupId, this->contactId);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[ADD_CONTACT_TO_GROUP] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->addContactToGroup(this->groupId, this->contactId);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -1017,22 +970,14 @@ namespace MSN {
void Soap::parseAddGroupResponse(std::string response) void Soap::parseAddGroupResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, ADD_GROUP);
if(preferredHostName) soapConnection->addGroup(this->groupName);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[ADD_GROUP] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->addGroup(this->groupName);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -1116,22 +1061,14 @@ namespace MSN {
void Soap::parseDelGroupResponse(std::string response) void Soap::parseDelGroupResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, DEL_GROUP);
if(preferredHostName) soapConnection->delGroup(this->groupId);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[DEL_GROUP] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->delGroup(this->groupId);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -1220,22 +1157,14 @@ namespace MSN {
void Soap::parseRenameGroupResponse(std::string response) void Soap::parseRenameGroupResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, RENAME_GROUP);
if(preferredHostName) soapConnection->renameGroup(this->groupId, this->groupName);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[RENAME_GROUP] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->renameGroup(this->groupId, this->groupName);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -1323,22 +1252,14 @@ namespace MSN {
void Soap::parseDelContactFromGroupResponse(std::string response) void Soap::parseDelContactFromGroupResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, DEL_CONTACT_FROM_GROUP);
if(preferredHostName) soapConnection->delContactFromGroup(this->groupId, this->contactId);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[DEL_CONTACT_FROM_GROUP] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->delContactFromGroup(this->groupId, this->contactId);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -1454,18 +1375,11 @@ namespace MSN {
void Soap::parseAddContactToListResponse(std::string response) void Soap::parseAddContactToListResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" )
{
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText();
if(preferredHostName)
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName); if(http_response_code == "301")
soapConnection->actionDomains[ADD_CONTACT_TO_LIST] = newdomain; {
soapConnection->setMBI(mbi); Soap *soapConnection = manageSoapRedirect(response1, ADD_CONTACT_TO_LIST);
soapConnection->addContactToList(this->tempPassport, this->tempList); soapConnection->addContactToList(this->tempPassport, this->tempList);
}
return; return;
} }
@ -1585,22 +1499,14 @@ namespace MSN {
void Soap::parseRemoveContactFromListResponse(std::string response) void Soap::parseRemoveContactFromListResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" )
{
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText();
if(preferredHostName)
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName); if(http_response_code == "301")
soapConnection->actionDomains[DEL_CONTACT_FROM_LIST] = newdomain; {
soapConnection->setMBI(mbi); Soap *soapConnection = manageSoapRedirect(response1, DEL_CONTACT_FROM_LIST);
soapConnection->removeContactFromList(this->tempPassport, this->tempList); soapConnection->removeContactFromList(this->tempPassport, this->tempList);
}
return; return;
} }
XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version"); XMLNode version = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("Version");
const char *ver = version.getText(); const char *ver = version.getText();
if(ver) if(ver)
@ -1709,20 +1615,11 @@ namespace MSN {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, GET_LISTS);
if(preferredHostName) soapConnection->getLists(this->listInfo);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[GET_LISTS] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->getLists(this->listInfo);
}
return; return;
} }
XMLNode Services = response1.getChildNode("soap:Envelope").getChildNode("soap:Body").getChildNode("FindMembershipResponse").getChildNode("FindMembershipResult").getChildNode("Services"); XMLNode Services = response1.getChildNode("soap:Envelope").getChildNode("soap:Body").getChildNode("FindMembershipResponse").getChildNode("FindMembershipResult").getChildNode("Services");
int nServices = Services.nChildNode("Service"); int nServices = Services.nChildNode("Service");
@ -1869,16 +1766,8 @@ namespace MSN {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, GET_ADDRESS_BOOK);
if(preferredHostName) soapConnection->getAddressBook(this->listInfo);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[GET_ADDRESS_BOOK] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->getAddressBook(this->listInfo);
}
return; return;
} }
@ -2075,20 +1964,11 @@ namespace MSN {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, RETRIEVE_OIM);
if(preferredHostName) soapConnection->getOIM(this->oim_id, this->markAsRead);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[RETRIEVE_OIM] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->getOIM(this->oim_id, this->markAsRead);
}
return; return;
} }
const char* msg = response1.getChildNode("soap:Envelope").getChildNode("soap:Body").getChildNode("GetMessageResponse").getChildNode("GetMessageResult").getText(); const char* msg = response1.getChildNode("soap:Envelope").getChildNode("soap:Body").getChildNode("GetMessageResponse").getChildNode("GetMessageResult").getText();
if(msg) if(msg)
{ {
@ -2160,18 +2040,11 @@ namespace MSN {
void Soap::parseDeleteOIMResponse(std::string response) void Soap::parseDeleteOIMResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, DELETE_OIM);
if(preferredHostName) soapConnection->deleteOIM(this->oim_id);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[DELETE_OIM] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->deleteOIM(this->oim_id);
}
return; return;
} }
@ -2225,23 +2098,15 @@ namespace MSN {
void Soap::parseGetMailDataResponse(std::string response) void Soap::parseGetMailDataResponse(std::string response)
{ {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" )
{
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText();
if(preferredHostName)
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName); if(http_response_code == "301")
soapConnection->actionDomains[RETRIEVE_OIM_MAIL_DATA] = newdomain; {
soapConnection->setMBI(mbi); Soap *soapConnection = manageSoapRedirect(response1, RETRIEVE_OIM_MAIL_DATA);
soapConnection->getMailData(); soapConnection->getMailData();
}
return; return;
} }
// oh my god! xml text as a field of a xml node! I cant believe it!
// oh my god! xml text as a field of a xml node! I cant believe it!
std::string maildata = response1.getChildNode("soap:Envelope").getChildNode("soap:Body").getChildNode("GetMetadataResponse").getChildNode("MD").createXMLString(false); std::string maildata = response1.getChildNode("soap:Envelope").getChildNode("soap:Body").getChildNode("GetMetadataResponse").getChildNode("MD").createXMLString(false);
if(maildata.empty()) if(maildata.empty())
return; // TODO - raise an error return; // TODO - raise an error
@ -2349,18 +2214,11 @@ namespace MSN {
OIM oim = this->oim; OIM oim = this->oim;
// probably we need to generate a new lockkey // probably we need to generate a new lockkey
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" )
{
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText();
if(preferredHostName)
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName); if(http_response_code == "301")
soapConnection->actionDomains[GENERATE_LOCKKEY] = newdomain; {
soapConnection->setMBI(mbi); Soap *soapConnection = manageSoapRedirect(response1, GENERATE_LOCKKEY);
soapConnection->generateLockkey(this->oim); soapConnection->generateLockkey(this->oim);
}
return; return;
} }
@ -2478,18 +2336,11 @@ namespace MSN {
{ {
OIM oim = this->oim; OIM oim = this->oim;
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" )
{
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText();
if(preferredHostName)
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName); if(http_response_code == "301")
soapConnection->actionDomains[SEND_OIM] = newdomain; {
soapConnection->setMBI(mbi); Soap *soapConnection = manageSoapRedirect(response1, SEND_OIM);
soapConnection->sendOIM(this->oim, this->lockkey); soapConnection->sendOIM(this->oim, this->lockkey);
}
return; return;
} }
@ -2576,16 +2427,8 @@ namespace MSN {
XMLNode response1 = XMLNode::parseString(response.c_str()); XMLNode response1 = XMLNode::parseString(response.c_str());
if(http_response_code == "301" ) if(http_response_code == "301" )
{ {
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText(); Soap *soapConnection = manageSoapRedirect(response1, CHANGE_DISPLAYNAME);
if(preferredHostName) soapConnection->changeDisplayName(this->tempDisplayName);
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
std::string newdomain(preferredHostName);
soapConnection->actionDomains[CHANGE_DISPLAYNAME] = newdomain;
soapConnection->setMBI(mbi);
soapConnection->changeDisplayName(this->tempDisplayName);
}
return; return;
} }
@ -2613,7 +2456,7 @@ namespace MSN {
return; return;
http_header_response = this->readBuffer.substr(0,this->readBuffer.find("\r\n\r\n") + 4); http_header_response = this->readBuffer.substr(0,this->readBuffer.find("\r\n\r\n") + 4);
Message::Headers headers = Message::Headers(http_header_response); Message::Headers headers = Message::Headers(http_header_response);
this->response_length = decimalFromString(headers["Content-Length"]); this->response_length = decimalFromString(headers["Content-Length"]);
this->http_response_code = splitString(http_header_response.substr(0,http_header_response.find("\r\n"))," ")[1]; this->http_response_code = splitString(http_header_response.substr(0,http_header_response.find("\r\n"))," ")[1];
@ -2698,6 +2541,34 @@ namespace MSN {
delete this; delete this;
} }
Soap* Soap::manageSoapRedirect(XMLNode response1, soapAction action)
{
Soap *soapConnection = new Soap(notificationServer, sitesToAuthList);
Message::Headers headers = Message::Headers(http_header_response);
std::string newdomain;
std::string location = headers["Location"];
const char *preferredHostName = response1.getChildNode("soap:Envelope").getChildNode("soap:Header").getChildNode("ServiceHeader").getChildNode("PreferredHostName").getText();
if(preferredHostName)
{
std::string newdomain(preferredHostName);
soapConnection->actionDomains[action] = newdomain;
}
if (location.size())
{
std::string newurl1(location);
std::vector<std::string> a = splitString(newurl1, "/");
std::string newdomain = splitString(a[1], "/")[0];
soapConnection->actionDomains[action] = newdomain;
std::vector<std::string> postpath = splitString(newurl1, newdomain);
soapConnection->actionPOSTURLs[action] = postpath[1];
}
soapConnection->setMBI(mbi);
return soapConnection;
}
void Soap::disconnect() void Soap::disconnect()
{ {
} }

View File

@ -23,18 +23,20 @@
*/ */
#include "connection.h" #include <connection.h>
#include "authdata.h" #include <authdata.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "buddy.h" #include <buddy.h>
#include "passport.h" #include <passport.h>
#include <stdexcept> #include <stdexcept>
#include "externals.h" #include <externals.h>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <map> #include <map>
#include "xmlParser.h"
#include "libmsn_export.h" #include "libmsn_export.h"
namespace MSN namespace MSN
@ -206,6 +208,8 @@ public:
void changeDisplayName(std::string newDisplayName); void changeDisplayName(std::string newDisplayName);
void parseChangeDisplayNameResponse(std::string); void parseChangeDisplayNameResponse(std::string);
Soap* manageSoapRedirect(XMLNode response1, soapAction action);
virtual void dispatchCommand(std::vector<std::string> &) {}; virtual void dispatchCommand(std::vector<std::string> &) {};
virtual void connect(const std::string &, unsigned int) {}; virtual void connect(const std::string &, unsigned int) {};
virtual void disconnect(); virtual void disconnect();

View File

@ -22,11 +22,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "switchboardserver.h" #include <switchboardserver.h>
#include "notificationserver.h" #include <notificationserver.h>
#include "errorcodes.h" #include <errorcodes.h>
#include "externals.h" #include <externals.h>
#include "util.h" #include <util.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -25,11 +25,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "message.h" #include <message.h>
#include "authdata.h" #include <authdata.h>
#include "connection.h" #include <connection.h>
#include "passport.h" #include <passport.h>
#include "p2p.h" #include <p2p.h>
#include <string> #include <string>
#include <cassert> #include <cassert>

View File

@ -22,7 +22,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <iostream> #include <iostream>
#include "util.h" #include <util.h>
#include <unistd.h>
#include <sstream> #include <sstream>
#include <errno.h> #include <errno.h>
#include <cctype> #include <cctype>
@ -30,9 +31,8 @@
#include <openssl/rand.h> #include <openssl/rand.h>
#include <cstring> #include <cstring>
#include <sys/timeb.h> #include <sys/timeb.h>
#include <posix/unistd.h> #include <md5.h>
#include "md5.h" #include <libsiren/siren7.h>
#include "libsiren/siren7.h"
#ifdef _WIN32 #ifdef _WIN32
#define random rand #define random rand

View File

@ -1,8 +1,10 @@
#include "MSN.h" #include "MSN.h"
extern "C" __declspec(dllexport) CayaProtocol* protocol(); extern "C" {
extern "C" __declspec(dllexport) const char* signature(); CayaProtocol* protocol();
extern "C" __declspec(dllexport) const char* friendly_signature(); const char* signature();
const char* friendly_signature();
}
CayaProtocol* CayaProtocol*
protocol() protocol()

View File

@ -33,10 +33,12 @@
const char * kProtocolSignature = "yahoo"; const char * kProtocolSignature = "yahoo";
const char * kProtocolName = "Yahoo"; const char * kProtocolName = "Yahoo";
extern "C" __declspec(dllexport) CayaProtocol* protocol(); extern "C" {
extern "C" __declspec(dllexport) const char* signature(); CayaProtocol* protocol();
extern "C" __declspec(dllexport) const char* friendly_signature(); const char* signature();
extern "C" void register_callbacks(); const char* friendly_signature();
void register_callbacks();
}
CayaProtocol* CayaProtocol*
protocol() protocol()