Version: (using KDE Devel) I have a fairly new ICQ account that apparently requires auth by default. The checkbox in Kopete's account configuration for this shows up as unchecked, when indeed the contact does require authorization from what I can tell using ICQlite.
I can't know if the account requires authorization when you first add the account, but I imagine that i can after the initial setup and first connection.
mattr: Precisely. In fact, this field (and maybe others) should maybe be disabled until some info can be fetched from the server (maybe the Edit Account dialog can have a button to "Verify Information" which would A> check your login credentials (prompting for a password if needed), and B> fetch info from the server, then immediately disconnect, updating and enabling additional options like this (of course, this button would be disabled for accounts that you had already signed on with).
Actually, when you're first setting up the account, the purpose of having the checkbox there is to tell the icq plugin that your account will require authorization so that it sets the proper flag on the ICQ server. However the verify information deal sounds interesting, i'll keep it in mind. Maybe I can pull some ideas from the official ICQ client on how they handle it.
post 3.2/0.8
There is no packet to get the auth setting off the server so all we can do is send it on every connect and risk overriding the setting done by another client.
I'll remove the checkbox altogether soon and it'll only come back if there's an usable way to find out if we authorized another user to message us. If it turns out that there's no reliable way in finding out if he's authorized or not we have to live without this option. I'll make this bug "UNCONFIRMED" until somebody finds out if the above is possible in ICQ (currently I don't see a way to do that).
*** Bug 71659 has been marked as a duplicate of this bug. ***
*** Bug 124443 has been marked as a duplicate of this bug. ***
SVN commit 601881 by rjarosz: Implement "Requires auth" option and update "Requires auth" and "Web Aware" settings on the server automatically. FEATURE: 71660 FEATURE: 74234 M +16 -2 icq/icqaccount.cpp M +17 -0 icq/ui/icqeditaccountwidget.cpp M +23 -9 liboscar/icquserinfo.cpp M +5 -3 liboscar/icquserinfo.h --- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/icqaccount.cpp #601880:601881 @@ -59,11 +59,25 @@ if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) return; - ICQShortInfo shortInfo = static_cast<ICQAccount*>( account() )->engine()->getShortInfo( contact ); + ICQAccount* icqAccount = static_cast<ICQAccount*>( account() ); + ICQShortInfo shortInfo = icqAccount->engine()->getShortInfo( contact ); if ( !shortInfo.nickname.isEmpty() ) { - setProperty( Kopete::Global::Properties::self()->nickName(), static_cast<ICQAccount*>( account() )->defaultCodec()->toUnicode( shortInfo.nickname ) ); + setProperty( Kopete::Global::Properties::self()->nickName(), icqAccount->defaultCodec()->toUnicode( shortInfo.nickname ) ); } + + //Sync server settings with local + QList<ICQInfoBase*> infoList; + + ICQShortInfo* info = new ICQShortInfo( shortInfo ); + + Oscar::Settings* oscarSettings = icqAccount->engine()->clientSettings(); + info->needsAuth.set( oscarSettings->requireAuth() ); + info->webAware.set( oscarSettings->webAware() ); + + infoList.append( info ); + if ( !icqAccount->engine()->updateProfile( infoList ) ) + qDeleteAll( infoList ); } void ICQMyselfContact::fetchShortInfo() --- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/ui/icqeditaccountwidget.cpp #601880:601881 @@ -41,6 +41,7 @@ #include "icqaccount.h" #include "icqcontact.h" #include "oscarprivacyengine.h" +#include "oscarsettings.h" ICQEditAccountWidget::ICQEditAccountWidget(ICQProtocol *protocol, Kopete::Account *account, QWidget *parent) @@ -180,17 +181,23 @@ mAccountSettings->mPasswordWidget->save(&mAccount->password()); mAccount->setExcludeConnect(mAccountSettings->chkAutoLogin->isChecked()); + Oscar::Settings* oscarSettings = mAccount->engine()->clientSettings(); + bool configChecked = mAccountSettings->chkRequireAuth->isChecked(); mAccount->configGroup()->writeEntry( "RequireAuth", configChecked ); + oscarSettings->setRequireAuth( configChecked ); configChecked = mAccountSettings->chkRespectRequireAuth->isChecked(); mAccount->configGroup()->writeEntry( "RespectRequireAuth", configChecked ); + oscarSettings->setRespectRequireAuth( configChecked ); configChecked = mAccountSettings->chkHideIP->isChecked(); mAccount->configGroup()->writeEntry( "HideIP", configChecked ); + oscarSettings->setHideIP( configChecked ); configChecked = mAccountSettings->chkWebAware->isChecked(); mAccount->configGroup()->writeEntry( "WebAware", configChecked ); + oscarSettings->setWebAware( configChecked ); int configValue = mProtocol->getCodeForCombo( mAccountSettings->encodingCombo, mProtocol->encodings() ); @@ -210,12 +217,19 @@ //set filetransfer stuff configChecked = mAccountSettings->chkFileProxy->isChecked(); mAccount->configGroup()->writeEntry( "FileProxy", configChecked ); + oscarSettings->setFileProxy( configChecked ); + configValue = mAccountSettings->sbxFirstPort->value(); mAccount->configGroup()->writeEntry( "FirstPort", configValue ); + oscarSettings->setFirstPort( configValue ); + configValue = mAccountSettings->sbxLastPort->value(); mAccount->configGroup()->writeEntry( "LastPort", configValue ); + oscarSettings->setLastPort( configValue ); + configValue = mAccountSettings->sbxTimeout->value(); mAccount->configGroup()->writeEntry( "Timeout", configValue ); + oscarSettings->setTimeout( configValue ); // Global Identity mAccount->configGroup()->writeEntry( "ExcludeGlobalIdentity", mAccountSettings->chkGlobalIdentity->isChecked() ); @@ -230,6 +244,9 @@ if ( m_ignoreEngine ) m_ignoreEngine->storeChanges(); + + //Update Oscar settings + static_cast<ICQMyselfContact*>( mAccount->myself() )->fetchShortInfo(); } return mAccount; --- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/icquserinfo.cpp #601880:601881 @@ -25,8 +25,8 @@ ICQShortInfo::ICQShortInfo() { uin = 0; - needsAuth = false; - gender = 0; + needsAuth.init( false ); + webAware.init( false ); } void ICQShortInfo::fill( Buffer* buffer ) @@ -38,14 +38,27 @@ firstName = buffer->getLELNTS(); lastName = buffer->getLELNTS(); email = buffer->getLELNTS(); - needsAuth = buffer->getByte(); - buffer->skipBytes( 1 ); //skip the unknown byte - gender = buffer->getByte(); + needsAuth = ( buffer->getByte() == 0x00 ); + webAware = ( buffer->getByte() != 0x02 ); +// gender = buffer->getByte(); } else kDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Couldn't parse ICQ short user info packet" << endl; } +void ICQShortInfo::store( Buffer* buffer ) +{ + if ( needsAuth.hasChanged() ) + { + buffer->addLETLV8( 0x02F8, ( needsAuth.get() ) ? 0x00 : 0x01 ); + } + + if ( webAware.hasChanged() ) + { + buffer->addLETLV8( 0x030C, ( webAware.get() ) ? 0x01 : 0x00 ); + } +} + ICQGeneralUserInfo::ICQGeneralUserInfo() { uin.init( 0 ); @@ -54,6 +67,7 @@ publishEmail.init( false ); webAware.init( false ); allowsDC.init( false ); + needsAuth.init( false ); } void ICQGeneralUserInfo::fill( Buffer* buffer ) @@ -74,7 +88,7 @@ zip = buffer->getLELNTS(); country = buffer->getLEWord(); timezone = buffer->getLEByte(); // UTC+(tzcode * 30min) - authorization = ( buffer->getByte() == 0x00 ); + needsAuth = ( buffer->getByte() == 0x00 ); webAware = ( buffer->getByte() == 0x01 ); allowsDC = ( buffer->getByte() == 0x01 ); //taken from sim publishEmail = ( buffer->getByte() == 0x01 ); @@ -162,11 +176,11 @@ } if ( webAware.hasChanged() ) { - buffer->addLETLV8( 0x02F8, ( webAware.get() ) ? 0x01 : 0x00 ); + buffer->addLETLV8( 0x030C, ( webAware.get() ) ? 0x01 : 0x00 ); } - if ( authorization.hasChanged() ) + if ( needsAuth.hasChanged() ) { - buffer->addLETLV8( 0x030C, ( authorization.get() ) ? 0x00 : 0x01 ); + buffer->addLETLV8( 0x02F8, ( needsAuth.get() ) ? 0x00 : 0x01 ); } } --- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/icquserinfo.h #601880:601881 @@ -56,6 +56,7 @@ ICQShortInfo(); ~ICQShortInfo() {} void fill( Buffer* buffer ); + void store( Buffer* buffer ); public: unsigned long uin; @@ -63,8 +64,9 @@ QByteArray firstName; QByteArray lastName; QByteArray email; - bool needsAuth; - unsigned int gender; // 0=offline, 1=online, 2=not webaware + ICQInfoValue<bool> needsAuth; + ICQInfoValue<bool> webAware; // 0=offline, 1=online, 2=not webaware +// unsigned int gender; }; class KOPETE_EXPORT ICQGeneralUserInfo : public ICQInfoBase @@ -93,7 +95,7 @@ ICQInfoValue<bool> publishEmail; ICQInfoValue<bool> allowsDC; ICQInfoValue<bool> webAware; - ICQInfoValue<bool> authorization; + ICQInfoValue<bool> needsAuth; }; class KOPETE_EXPORT ICQWorkUserInfo : public ICQInfoBase