SVN commit 773131 by rjarosz:
Show authorization dialog when user adds contact that
requires authorization.
GUI:
M +4 -1 oscaraccount.cpp
M +13 -0 oscarcontact.cpp
M +2 -0 oscarcontact.h
---
trunk/KDE/kdenetwork/kopete/protocols/oscar/oscaraccount.cpp
#773130:773131
 -686,8
+686,11 
{
kDebug(OSCAR_GEN_DEBUG) << "Received
confirmation from server. adding " <<
item.name()
<< " to the contact list" <<
endl;
- createNewContact( item.name(),
d->addContactMap[normalizedName], item );
+ OscarContact* oc = createNewContact( item.name(),
d->addContactMap[normalizedName], item );
d->addContactMap.remove( normalizedName );
+
+ if ( oc && oc->ssiItem().waitingAuth() )
+ QTimer::singleShot( 1, oc, SLOT(requestAuthorization())
);
}
else if ( contacts()[item.name()] )
{
---
trunk/KDE/kdenetwork/kopete/protocols/oscar/oscarcontact.cpp
#773130:773131
 -29,6
+29,7 
#include <kcodecs.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
+#include <kinputdialog.h>
#include <kdeversion.h>
#include <kfiledialog.h>
 -352,6
+353,18 
m_oesd->show();
}
+void OscarContact::requestAuthorization()
+{
+ QString info = i18n("The user %1 requires
authorization before being added to a contact list. "
+ "Do you want to send an
authorization request?nnReason for requesting
authorization:",
+ ( !nickName().isEmpty() ) ? nickName()
: contactId() );
+
+ QString reason = KInputDialog::getText( i18n("Request
Authorization"), info,
+ i18n("Please
authorize me so I can add you to my contact list") );
+ if ( !reason.isNull() )
+ mAccount->engine()->requestAuth( contactId(),
reason );
+}
+
void OscarContact::changeEncodingDialogClosed( int result
)
{
if ( result == QDialog::Accepted )
---
trunk/KDE/kdenetwork/kopete/protocols/oscar/oscarcontact.h
#773130:773131
 -139,6
+139,8 
/** change contact encoding */
void changeContactEncoding();
+ void requestAuthorization();
+
protected slots:
void slotTyping( bool typing );
_______________________________________________
kde-docbook mailing list
kde-docbook kde.org
htt
ps://mail.kde.org/mailman/listinfo/kde-docbook
|