mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
sipjreen: Add authError signal
This commit is contained in:
@@ -109,6 +109,8 @@ JabberPlugin::connectPlugin( bool startup )
|
|||||||
QObject::connect( p, SIGNAL( connected() ), SLOT( onConnected() ) );
|
QObject::connect( p, SIGNAL( connected() ), SLOT( onConnected() ) );
|
||||||
QObject::connect( p, SIGNAL( disconnected() ), SLOT( onDisconnected() ) );
|
QObject::connect( p, SIGNAL( disconnected() ), SLOT( onDisconnected() ) );
|
||||||
|
|
||||||
|
QObject::connect( p, SIGNAL( authError( int, QString ) ), SLOT( onAuthError( int, QString ) ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +158,33 @@ JabberPlugin::onDisconnected()
|
|||||||
emit disconnected();
|
emit disconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
JabberPlugin::onAuthError( int code, const QString& msg )
|
||||||
|
{
|
||||||
|
switch( code )
|
||||||
|
{
|
||||||
|
case Jreen::Client::AuthorizationError:
|
||||||
|
emit error( SipPlugin::AuthError, msg );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Jreen::Client::HostUnknown:
|
||||||
|
case Jreen::Client::ItemNotFound:
|
||||||
|
case Jreen::Client::RemoteStreamError:
|
||||||
|
case Jreen::Client::RemoteConnectionFailed:
|
||||||
|
case Jreen::Client::InternalServerError:
|
||||||
|
case Jreen::Client::SystemShutdown:
|
||||||
|
case Jreen::Client::Conflict:
|
||||||
|
case Jreen::Client::Unknown:
|
||||||
|
emit error( SipPlugin::ConnectionError, msg );
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
qDebug() << "Not all Client::DisconnectReasons checked";
|
||||||
|
Q_ASSERT(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
JabberPlugin::sendMsg(const QString& to, const QString& msg)
|
JabberPlugin::sendMsg(const QString& to, const QString& msg)
|
||||||
{
|
{
|
||||||
|
@@ -57,6 +57,7 @@ private slots:
|
|||||||
void showAddFriendDialog();
|
void showAddFriendDialog();
|
||||||
void onConnected();
|
void onConnected();
|
||||||
void onDisconnected();
|
void onDisconnected();
|
||||||
|
void onAuthError(int code, const QString &msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Jabber_p* p;
|
Jabber_p* p;
|
||||||
|
@@ -283,6 +283,10 @@ Jabber_p::onDisconnect( Jreen::Client::DisconnectReason reason )
|
|||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "Disconnected from server:" << error;
|
qDebug() << "Disconnected from server:" << error;
|
||||||
|
if( reason != Jreen::Client::User )
|
||||||
|
{
|
||||||
|
emit authError( reason, error );
|
||||||
|
}
|
||||||
|
|
||||||
if(reconnect)
|
if(reconnect)
|
||||||
QTimer::singleShot(reconnectInSeconds*1000, m_client, SLOT(connectToServer()));
|
QTimer::singleShot(reconnectInSeconds*1000, m_client, SLOT(connectToServer()));
|
||||||
|
Reference in New Issue
Block a user