mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
sipjreen: Add I'm-not-a-person-auto-response
This commit is contained in:
@@ -303,6 +303,22 @@ Jabber_p::onNewMessage( const Jreen::Message& m )
|
|||||||
if ( msg.isEmpty() )
|
if ( msg.isEmpty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QJson::Parser parser;
|
||||||
|
bool ok;
|
||||||
|
QVariant v = parser.parse( msg.toAscii(), &ok );
|
||||||
|
if ( !ok || v.type() != QVariant::Map )
|
||||||
|
{
|
||||||
|
QString to = from;
|
||||||
|
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"
|
||||||
|
" are trying to reach is probably not signed on, so please try again later!") );
|
||||||
|
|
||||||
|
// this is not a sip message, so we send it directly through the client
|
||||||
|
m_client->send( Jreen::Message ( Jreen::Message::Chat, Jreen::JID(to), response) );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "From:" << m.from().full() << ":" << m.body();
|
qDebug() << Q_FUNC_INFO << "From:" << m.from().full() << ":" << m.body();
|
||||||
emit msgReceived( from, msg );
|
emit msgReceived( from, msg );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user