1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Hopefully fix problems with the auto-message going to gtalk users

This commit is contained in:
Jeff Mitchell
2011-04-29 08:30:07 -04:00
parent b2a0e41eab
commit 48f1745614
2 changed files with 13 additions and 0 deletions

View File

@@ -18,6 +18,8 @@
#include "jabber_p.h" #include "jabber_p.h"
#include <string>
#include <QDebug> #include <QDebug>
#include <QTime> #include <QTime>
#include <QTimer> #include <QTimer>
@@ -456,6 +458,11 @@ Jabber_p::handleMessage( const gloox::Message& m, gloox::MessageSession * /*sess
QVariant v = parser.parse( msg.toAscii(), &ok ); QVariant v = parser.parse( msg.toAscii(), &ok );
if ( !ok || v.type() != QVariant::Map ) if ( !ok || v.type() != QVariant::Map )
{ {
if ( m.from().server().find( "googlemail." ) != string::npos
|| m.from().server().find( "gmail." ) != string::npos
|| m.from().server().find( "gtalk." ) != string::npos )
return;
sendMsg( from, QString( "I'm sorry -- I'm just an automatic presence used by Tomahawk Player (http://gettomahawk.com). If you are getting this message, the person you are trying to reach is probably not signed on, so please try again later!" ) ); sendMsg( from, QString( "I'm sorry -- I'm just an automatic presence used by Tomahawk Player (http://gettomahawk.com). If you are getting this message, the person you are trying to reach is probably not signed on, so please try again later!" ) );
return; return;
} }

View File

@@ -334,6 +334,12 @@ Jabber_p::onNewMessage( const Jreen::Message& m )
QVariant v = parser.parse( msg.toAscii(), &ok ); QVariant v = parser.parse( msg.toAscii(), &ok );
if ( !ok || v.type() != QVariant::Map ) if ( !ok || v.type() != QVariant::Map )
{ {
if ( m.from().domain().contains( "googlemail." )
|| m.from().domain().contains( "gmail." )
|| m.from().domain().contains( "gtalk." )
)
return;
QString to = from; QString to = from;
QString response = QString( tr("I'm sorry -- I'm just an automatic presence used by Tomahawk Player" QString response = QString( tr("I'm sorry -- I'm just an automatic presence used by Tomahawk Player"
" (http://gettomahawk.com). If you are getting this message, the person you" " (http://gettomahawk.com). If you are getting this message, the person you"