[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenetwork/kopete/protocols/oscar
From:       Will Stephenson <lists () stevello ! free-online ! co ! uk>
Date:       2005-03-15 23:03:25
Message-ID: 20050315230325.6D9B512E73 () office ! kde ! org
[Download RAW message or body]

CVS commit by wstephens: 

Fix sending typing notifications for ICQ.
BUG:101037


  M +3 -2      oscaraccount.cpp   1.171
  M +8 -2      oscarcontact.cpp   1.169
  M +3 -0      oscarcontact.h   1.94
  M +5 -1      liboscar/client.cpp   1.9
  M +3 -0      liboscar/client.h   1.9
  M +7 -1      liboscar/typingnotifytask.cpp   1.3
  M +2 -1      liboscar/typingnotifytask.h   1.2


--- kdenetwork/kopete/protocols/oscar/oscaraccount.cpp  #1.170:1.171
@@ -478,5 +478,5 @@ void OscarAccount::userStartedTyping( co
 {
         Kopete::Contact * ct = contacts()[ Oscar::normalize( contact ) ];
-        if ( ct )
+        if ( ct && contact != accountId() )
         {
                 OscarContact * oc = static_cast<OscarContact *>( ct );
@@ -488,5 +488,5 @@ void OscarAccount::userStoppedTyping( co
 {
         Kopete::Contact * ct = contacts()[ Oscar::normalize( contact ) ];
-        if ( ct )
+        if ( ct && contact != accountId() )
         {
                 OscarContact * oc = static_cast<OscarContact *>( ct );

--- kdenetwork/kopete/protocols/oscar/oscarcontact.cpp  #1.168:1.169
@@ -105,6 +105,6 @@ Kopete::ChatSession* OscarContact::manag
                         this, SLOT( chatSessionDestroyed() ) );
 
-/*              connect(mMsgManager, SIGNAL( myselfTyping( bool ) ),
-                        this, SLOT( slotTyping( bool ) ) );*/
+                connect(mMsgManager, SIGNAL( myselfTyping( bool ) ),
+                        this, SLOT( slotTyping( bool ) ) );
         }
         return mMsgManager;
@@ -215,4 +215,10 @@ void OscarContact::stoppedTyping()
 }
 
+void OscarContact::slotTyping( bool typing )
+{
+        if ( this != account()->myself() )
+                account()->engine()->sendTyping( contactId(), typing );
+}
+
 #include "oscarcontact.moc"
 //kate: tab-width 4; indent-mode csands;

--- kdenetwork/kopete/protocols/oscar/oscarcontact.h  #1.93:1.94
@@ -102,4 +102,7 @@ public slots:
         virtual void userOffline( const QString& ) = 0;
 
+protected slots:
+        void slotTyping( bool typing );
+
 signals:
         void updatedSSI();

--- kdenetwork/kopete/protocols/oscar/liboscar/client.cpp  #1.8:1.9
@@ -690,5 +690,9 @@ void Client::updateProfile( const QStrin
 }
 
-
+void Client::sendTyping( const QString & contact, bool typing )
+{
+d->typingNotifyTask->setParams( contact, ( typing ? TypingNotifyTask::Begin : \
TypingNotifyTask::Finished ) ); +        d->typingNotifyTask->go( false );       // \
don't delete the task after sending +}
 #include "client.moc"
 

--- kdenetwork/kopete/protocols/oscar/liboscar/client.h  #1.8:1.9
@@ -232,4 +232,7 @@ public:
         int port();
 
+        /** Send a typing notification */
+        void sendTyping( const QString & contact, bool typing );
+
         /*************
           INTERNAL (FOR USE BY TASKS) METHODS 

--- kdenetwork/kopete/protocols/oscar/liboscar/typingnotifytask.cpp  #1.2:1.3
@@ -72,5 +72,5 @@ void TypingNotifyTask::onGo()
         b->addWord( 0x0001 ); //mtn messages are always sent as type 1 messages
         
-        b->addBUIN( client()->userId().latin1() );
+        b->addBUIN( m_contact.latin1() );
         
         b->addWord( m_notificationType );
@@ -112,4 +112,10 @@ void TypingNotifyTask::handleNotificatio
 }
 
+void TypingNotifyTask::setParams( const QString& contact, int notifyType )
+{
+        m_contact = contact;
+        m_notificationType = notifyType;
+}
+
 #include "typingnotifytask.moc"
 

--- kdenetwork/kopete/protocols/oscar/liboscar/typingnotifytask.h  #1.1:1.2
@@ -39,5 +39,5 @@ public:
         virtual void onGo();
         
-        void setNotification( int notifyType );
+        void setParams( const QString & contact, int notifyType );
         
 signals:
@@ -55,4 +55,5 @@ private:
 private:
         WORD m_notificationType;
+        QString m_contact;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic