Import release 2.0beta1

This commit is contained in:
Mario Fetka
2009-03-23 23:26:37 +00:00
parent 8b3dac7ce6
commit a899084e37
373 changed files with 147541 additions and 68476 deletions
+12 -9
View File
@@ -481,7 +481,7 @@ bool ApplicationList::contactLeftChat(bool userInitiated)
MimeApplication * ApplicationList::createApplication(const MimeMessage &message)
{
MimeApplication *app = 0;
QString appGuid = message.getValue("Application-GUID");
QString appGuid( message.getValue("Application-GUID") );
// If no GUID is found:
if( appGuid.isEmpty() )
@@ -540,14 +540,14 @@ P2PApplication * ApplicationList::createApplication(const P2PMessage &message)
P2PApplication *app = 0;
// Extract the SLP data message
QString slpMessage = QString::fromUtf8( message.getData(), (int) message.getDataSize() );
QString slpMessage( QString::fromUtf8( message.getData(), (int) message.getDataSize() ) );
if(! slpMessage.startsWith("INVITE"))
{
// Not an invite message
// this belongs to another session, but gotMessage() couldn't find it.
// Likely a P2PApplication object terminated prematurely.
QString preamble = slpMessage.left( qMin(slpMessage.indexOf(":"), 20) );
QString preamble( slpMessage.left( qMin(slpMessage.indexOf(":"), 20) ) );
kWarning() << "P2P message can't be handled, detected SLP message but no INVITE. "
"P2PApplication already terminated? "
"(slp-preamble=" << preamble <<
@@ -983,7 +983,9 @@ void ApplicationList::gotMessage(const P2PMessage &message)
}
}
}
else if( message.getFlags() != 0 && message.getDataSize() == 0 )
else if( message.getFlags() != 0
&& message.getFlags() != P2PMessage::MSN_FLAG_OBJECT_DATA // WLM2009 uses 0x1000000 instead of 0x00.
&& message.getDataSize() == 0 )
{
// This can also be a connection handshake, even though it shouldn't appear at the switchboard.
// That occurs when the connection was closed before that packet could be sent.
@@ -1013,8 +1015,7 @@ void ApplicationList::gotMessage(const P2PMessage &message)
// HACK: added for bot Bot2k3 4.1 (sends first ack without UniqueID, flags or any other context)
kWarning() << "SwitchBoard P2P message has no ACK fields set at all, assuming base identifier message!";
}
else if( message.getFlags() == 0
&& message.getDataSize() > 0) // HACK: added size constraint for Bot2k3 4.1 (sends an empty message with a zero flag)
else if( message.isSlpData() )
{
// It's a negotiation/MSNSLP message
if( message.getDataOffset() > 0 )
@@ -1041,7 +1042,7 @@ void ApplicationList::gotMessage(const P2PMessage &message)
}
else
{
QString callID = callRE.cap(1);
QString callID( callRE.cap(1) );
// See if it's a null-guid.
// This happens for the out-of-band SLP "application/x-msnmsgr-transdestaddrupdate" and "application/x-msnmsgr-transudpswitch" messages.
@@ -1139,7 +1140,9 @@ void ApplicationList::gotMessage(const P2PMessage &message)
// If we didn't find the application, the message had bad fields
// or we don't support the invitation type:
if( message.getFlags() != 0 && message.getDataSize() == 0 )
if( message.getFlags() != 0
&& message.getFlags() != P2PMessage::MSN_FLAG_OBJECT_DATA // WLM2009 uses 0x1000000 instead of 0x00.
&& message.getDataSize() == 0 )
{
#ifdef KMESSDEBUG_APPLICATIONLIST_GENERAL
kDebug() << "Not sending a P2P Error response for error message.";
@@ -1459,7 +1462,7 @@ void ApplicationList::resumeApplications(bool /*isPrivateChat*/)
*/
void ApplicationList::sendMessage(const MimeApplication *source, const MimeMessage &messageData)
{
QString messageBody = messageData.getFields();
QString messageBody( messageData.getFields() );
#ifdef KMESSTEST
// Check whether a QByteArray is passed. gcc is able to create the cast
// because MimeMessage() has a constructor which accepts a QByteArray.