Skip to content
Browse files

* Cleaned up Jabber auth.

  • Loading branch information...
1 parent 4d23dea commit e24aea480ebc0aefc2dc96864a13260e905c020d @muesli muesli committed Mar 28, 2011
Showing with 13 additions and 14 deletions.
  1. +12 −13 src/sip/jabber/jabber_p.cpp
  2. +1 −1 src/sip/jabber/jabber_p.h
View
25 src/sip/jabber/jabber_p.cpp
@@ -638,9 +638,9 @@ Jabber_p::handleSubscriptionRequest( const JID& jid, const std::string& /*msg*/
// preparing the confirm box for the user
QMessageBox *confirmBox = new QMessageBox(
QMessageBox::Question,
- tr("Friend Request in Jabber"),
- QString(tr("Do you want to be friends with <b>%1</b>?")).arg(QLatin1String(jid.bare().c_str())),
- QMessageBox::Ok | QMessageBox::Cancel,
+ tr( "Authorize User" ),
+ QString( tr( "Do you want to grant <b>%1</b> access to your Collection?" ) ).arg( QLatin1String( jid.bare().c_str() ) ),
+ QMessageBox::Yes | QMessageBox::No,
0
);
@@ -653,14 +653,16 @@ Jabber_p::handleSubscriptionRequest( const JID& jid, const std::string& /*msg*/
return false;
}
+
void
-Jabber_p::onSubscriptionRequestConfirmed(int result)
+Jabber_p::onSubscriptionRequestConfirmed( int result )
{
qDebug() << Q_FUNC_INFO << result;
QList< QMessageBox* > confirmBoxes = m_subscriptionConfirmBoxes.values();
JID jid;
- foreach(QMessageBox* currentBox, confirmBoxes)
+
+ foreach( QMessageBox* currentBox, confirmBoxes )
{
if( currentBox == sender() )
{
@@ -674,27 +676,24 @@ Jabber_p::onSubscriptionRequestConfirmed(int result)
m_subscriptionConfirmBoxes.remove( jid );
sender()->deleteLater();
- QMessageBox::StandardButton allowSubscription = static_cast<QMessageBox::StandardButton>( result );
+ QMessageBox::StandardButton allowSubscription = static_cast<QMessageBox::StandardButton>( result );
- if(allowSubscription == QMessageBox::Ok)
+ if ( allowSubscription == QMessageBox::Yes )
{
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "accepted by user, adding to roster";
StringList groups;
groups.push_back( "Tomahawk" );
m_client->rosterManager()->subscribe( jid, "", groups, "" );
-
- // ack the request
- m_client->rosterManager()->ackSubscriptionRequest( jid, true );
}
else
{
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "declined by user";
-
- // decl the request
- m_client->rosterManager()->ackSubscriptionRequest( jid, false );
}
+
+ m_client->rosterManager()->ackSubscriptionRequest( jid, allowSubscription == QMessageBox::Yes );
}
+
bool
Jabber_p::handleUnsubscriptionRequest( const JID& jid, const std::string& /*msg*/ )
{
View
2 src/sip/jabber/jabber_p.h
@@ -154,7 +154,7 @@ public slots:
private slots:
void doJabberRecv();
- void onSubscriptionRequestConfirmed(int result);
+ void onSubscriptionRequestConfirmed( int result );
private:
bool presenceMeansOnline( gloox::Presence::PresenceType p );

0 comments on commit e24aea4

Please sign in to comment.
Something went wrong with that request. Please try again.