Bug 85117 - [liboscar/icq] password changing support for ICQ
Summary: [liboscar/icq] password changing support for ICQ
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: ICQ and AIM Plugins (show other bugs)
Version: SVN
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 144458 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-13 21:24 UTC by Norberto Bensa
Modified: 2007-06-03 21:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norberto Bensa 2004-07-13 21:24:59 UTC
Version:           0.8.91 (CVS >= 20040626) (using KDE 3.2.91 (CVS >= 20040706), Gentoo)
Compiler:          gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.6.7-mm7

some IM protocols allow to change passwords; at least ICQ and Jabber have this feature. Could you please add support for this? 

Thanks,
Norberto
Comment 1 Casey Allen Shobe 2004-07-14 20:42:18 UTC
This is on the way for Gadu-Gadu and Jabber...for 0.10.x.
Comment 2 Michael 2004-12-14 05:11:13 UTC
Can't wait to see this. :)
Comment 3 Matt Rogers 2005-04-26 18:14:37 UTC
Assuming this has been done for gadu and jabber for 0.10 and reassigning to ICQ.
Comment 4 Roman Jarosz 2006-11-11 22:40:42 UTC
SVN commit 604174 by rjarosz:

Add feature 85117: [liboscar/icq] password changing support for ICQ.

FEATURE: 85117
GUI:



 M  +3 -1      icq/CMakeLists.txt  
 A             icq/ui/icqchangepassword.ui  
 A             icq/ui/icqchangepassworddialog.cpp   [License: LGPL (v2+)]
 A             icq/ui/icqchangepassworddialog.h   [License: LGPL (v2+)]
 M  +54 -5     icq/ui/icqeditaccountui.ui  
 M  +10 -0     icq/ui/icqeditaccountwidget.cpp  
 M  +1 -0      icq/ui/icqeditaccountwidget.h  
 M  +1 -1      liboscar/CMakeLists.txt  
 M  +23 -0     liboscar/client.cpp  
 M  +12 -0     liboscar/client.h  
 A             liboscar/icqchangepasswordtask.cpp   [License: LGPL (v2+)]
 A             liboscar/icqchangepasswordtask.h   [License: LGPL (v2+)]


--- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/CMakeLists.txt #604173:604174
@@ -19,6 +19,7 @@
 ui/icqauthreplydialog.cpp 
 ui/icqaddcontactpage.cpp 
 ui/icqsearchdialog.cpp
+ui/icqchangepassworddialog.cpp
 )
 
 kde4_add_ui_files(kopete_icq_ui_SRCS 
@@ -31,7 +32,8 @@
 ui/icqorgaffinfowidget.ui 
 ui/icqauthreplyui.ui 
 ui/icqsearchbase.ui 
-ui/icqeditaccountui.ui 
+ui/icqeditaccountui.ui
+ui/icqchangepassword.ui
 )
 
 set(kopete_icq_PART_SRCS 
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/ui/icqeditaccountui.ui #604173:604174
@@ -5,21 +5,21 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>547</width>
-    <height>525</height>
+    <width>552</width>
+    <height>530</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Account Preferences - ICQ</string>
   </property>
-  <layout class="QGridLayout" >
+  <layout class="QVBoxLayout" >
    <property name="margin" >
     <number>9</number>
    </property>
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="0" column="0" >
+   <item>
     <widget class="QTabWidget" name="tabWidget7" >
      <property name="currentIndex" >
       <number>0</number>
@@ -160,6 +160,54 @@
         </widget>
        </item>
        <item>
+        <widget class="QGroupBox" name="groupBox_5" >
+         <property name="title" >
+          <string>Change password</string>
+         </property>
+         <layout class="QHBoxLayout" >
+          <property name="margin" >
+           <number>9</number>
+          </property>
+          <property name="spacing" >
+           <number>6</number>
+          </property>
+          <item>
+           <widget class="QLabel" name="label" >
+            <property name="sizePolicy" >
+             <sizepolicy>
+              <hsizetype>7</hsizetype>
+              <vsizetype>5</vsizetype>
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text" >
+             <string>If you have an existing ICQ account and would like to change its password, you can use this button to enter a new password.</string>
+            </property>
+            <property name="wordWrap" >
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="buttonChangePassword" >
+            <property name="sizePolicy" >
+             <sizepolicy>
+              <hsizetype>1</hsizetype>
+              <vsizetype>0</vsizetype>
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text" >
+             <string>Change Your Password</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
         <spacer>
          <property name="orientation" >
           <enum>Qt::Vertical</enum>
@@ -753,7 +801,7 @@
      </widget>
     </widget>
    </item>
-   <item row="1" column="0" >
+   <item>
     <widget class="QLabel" name="labelStatusMessage" >
      <property name="text" >
       <string/>
@@ -779,6 +827,7 @@
   <tabstop>chkAutoLogin</tabstop>
   <tabstop>chkGlobalIdentity</tabstop>
   <tabstop>buttonRegister</tabstop>
+  <tabstop>buttonChangePassword</tabstop>
   <tabstop>optionOverrideServer</tabstop>
   <tabstop>edtServerAddress</tabstop>
   <tabstop>edtServerPort</tabstop>
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/ui/icqeditaccountwidget.cpp #604173:604174
@@ -42,6 +42,7 @@
 #include "icqcontact.h"
 #include "oscarprivacyengine.h"
 #include "oscarsettings.h"
+#include "icqchangepassworddialog.h"
 
 ICQEditAccountWidget::ICQEditAccountWidget(ICQProtocol *protocol,
 	Kopete::Account *account, QWidget *parent)
@@ -142,9 +143,11 @@
 		mAccountSettings->tabVisible->setEnabled( false );
 		mAccountSettings->tabInvisible->setEnabled( false );
 		mAccountSettings->tabIgnore->setEnabled( false );
+		mAccountSettings->buttonChangePassword->setEnabled( false );
 	}
 
 	QObject::connect(mAccountSettings->buttonRegister, SIGNAL(clicked()), this, SLOT(slotOpenRegister()));
+	QObject::connect(mAccountSettings->buttonChangePassword, SIGNAL(clicked()), this, SLOT(slotChangePassword()));
 
 	/* Set tab order to password custom widget correctly */
 	QWidget::setTabOrder( mAccountSettings->edtAccountId, mAccountSettings->mPasswordWidget->mRemembered );
@@ -283,6 +286,13 @@
 	KToolInvocation::invokeBrowser( QLatin1String("http://go.icq.com/register/") );
 }
 
+void ICQEditAccountWidget::slotChangePassword()
+{
+	ICQChangePasswordDialog *passwordDlg = new ICQChangePasswordDialog( mAccount, this );
+	passwordDlg->exec();
+	delete passwordDlg;
+}
+
 #include "icqeditaccountwidget.moc"
 // vim: set noet ts=4 sts=4 sw=4:
 // kate: indent-mode csands; space-indent off; replace-tabs off;
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/ui/icqeditaccountwidget.h #604173:604174
@@ -45,6 +45,7 @@
 	
 private slots:
 	void slotOpenRegister();
+	void slotChangePassword();
 	
 protected:
 	ICQAccount *mAccount;
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/CMakeLists.txt #604173:604174
@@ -24,7 +24,7 @@
 usersearchtask.cpp warningtask.cpp changevisibilitytask.cpp typingnotifytask.cpp 
 buddyicontask.cpp serverredirecttask.cpp oscarsettings.cpp filetransfertask.cpp
 localcontactlisttask.cpp chatnavservicetask.cpp connectionhandler.cpp chatservicetask.cpp oscarguid.cpp 
-icquserinfoupdatetask.cpp
+icquserinfoupdatetask.cpp icqchangepasswordtask.cpp
 )
 
 kde4_automoc(${liboscar_SRCS} )
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/client.cpp #604173:604174
@@ -63,6 +63,7 @@
 #include "chatservicetask.h"
 #include "rateclassmanager.h"
 #include "icquserinfoupdatetask.h"
+#include "icqchangepasswordtask.h"
 
 
 namespace
@@ -802,6 +803,28 @@
 	warnTask->go( true );
 }
 
+bool Client::changeICQPassword( const QString& password )
+{
+	Connection* c = d->connections.connectionForFamily( 0x0015 );
+	if ( !c )
+		return false;
+
+	ICQChangePasswordTask* task = new ICQChangePasswordTask( c->rootTask() );
+	QObject::connect( task, SIGNAL(finished()), this, SLOT(changeICQPasswordFinished()) );
+	task->setPassword( password );
+	task->go( true );
+	return true;
+}
+
+void Client::changeICQPasswordFinished()
+{
+	ICQChangePasswordTask* task = (ICQChangePasswordTask*)sender();
+	if ( task->success() )
+		d->pass = task->password();
+
+	emit icqPasswordChanged( !task->success() );
+}
+
 ICQGeneralUserInfo Client::getGeneralInfo( const QString& contact )
 {
 	return d->icqInfoTask->generalInfoFor( contact );
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/client.h #604173:604174
@@ -207,6 +207,12 @@
 	void sendWarning( const QString& contact, bool anonymous );
 
 	/**
+	 * Change ICQ password
+	 * \param password your new password
+	 */
+	bool changeICQPassword( const QString& password );
+
+	/**
 	 * Get the general ICQ info for a client
 	 * \param contact the contact to get info for
 	 */
@@ -418,6 +424,9 @@
 	/** we've received an authorization reply */
 	void authReplyReceived( const QString& contact, const QString& reason, bool auth );
 
+	/** we've received a ICQ password change reply */
+	void icqPasswordChanged( bool error );
+
 	/**
 	 * we've received an error from a task and need to notify somebody
 	 */
@@ -524,6 +533,9 @@
 
 	void nextICQAwayMessageRequest();
 
+	/** Change ICQ password finished */
+	void changeICQPasswordFinished();
+
 private:
 
 	/** Initialize some static tasks */
Comment 5 Roman Jarosz 2007-06-03 21:07:46 UTC
*** Bug 144458 has been marked as a duplicate of this bug. ***