Bug 122468 - Notification if someone reads your away message
Summary: Notification if someone reads your away message
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: ICQ and AIM Plugins (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Roman Jarosz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-22 09:52 UTC by Mathias Soeken
Modified: 2006-11-14 11:29 UTC (History)
0 users

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 Mathias Soeken 2006-02-22 09:52:42 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Ubuntu Packages

In Miranda there is a plugin (no source code available) which notifies the user, if someone is reading his/her away message. It cannot work like the "Now listening" plugin, because it uses a timer. I know that it is possible for the icq protocol, but I do not know if it is possible for other ones. If someone could give me a hint as comment, I could try to write a plugin for this wish.
Comment 1 Armin Bruckhoff 2006-02-27 17:47:26 UTC
This would really be a nice feature in Kopete. :)

Licq does the notification by showing a blinking frame around the contact who read my away message. I had a (very short) glimpse at the licq source code, and it's probably hidden somewhere in its monstrous CICQDaemon::ProcessTcpPacket method in icqd-tcp.cpp. Search for "ICQ_CMDxTCP_READxAWAYxMSG".

HTH :)
Comment 2 Will Stephenson 2006-11-05 23:06:09 UTC
ICQ team, can it be done?
Comment 3 Matt Rogers 2006-11-08 14:35:35 UTC
Possible, sure. Whether or not it'll actually be done is another story
Comment 4 Mathias Soeken 2006-11-08 20:30:22 UTC
Perhaps the question is, how difficult the task is? Are there already events that notifies if somebody reads your away message or is the away message sent to a server after setting it?
Comment 5 Matt Rogers 2006-11-09 01:26:24 UTC
it has nothing to do with how difficult it is (since it's not really all that difficult) but whether or not somebody actually does it
Comment 6 Roman Jarosz 2006-11-14 11:29:36 UTC
SVN commit 604788 by rjarosz:

Add ICQ feature 122468: Notification if someone reads your away message

FEATURE: 122468



 M  +5 -0      kopete/kopete.notifyrc  
 M  +19 -0     protocols/oscar/icq/icqaccount.cpp  
 M  +2 -0      protocols/oscar/icq/icqaccount.h  
 M  +1 -0      protocols/oscar/liboscar/client.cpp  
 M  +1 -0      protocols/oscar/liboscar/client.h  


--- trunk/KDE/kdenetwork/kopete/kopete/kopete.notifyrc #604787:604788
@@ -126,3 +126,8 @@
 Name=Message dropped
 Comment=A message was filtered by the Privacy Plugin
 Action=PassivePopup
+
+[Event/icq_user_reads_status_message]
+Name=ICQ Reading status
+Comment=An ICQ user is reading your status message
+Action=PassivePopup
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/icqaccount.cpp #604787:604788
@@ -21,6 +21,7 @@
 #include <kmenu.h>
 #include <kmessagebox.h>
 #include <kicon.h>
+#include <knotification.h>
 
 #include "kopeteawayaction.h"
 #include "kopetemessage.h"
@@ -99,6 +100,9 @@
 	mInfoWidget = 0L;
 	mInitialStatusMessage.clear();
 
+	QObject::connect( engine(), SIGNAL(userReadsStatusMessage(const QString&)),
+	                  this, SLOT(userReadsStatusMessage(const QString&)) );
+
 	//setIgnoreUnknownContacts(pluginData(protocol(), "IgnoreUnknownContacts").toUInt() == 1);
 
 	/* FIXME: need to do this when web aware or hide ip change
@@ -269,6 +273,21 @@
 	mInfoWidget = 0L;
 }
 
+void ICQAccount::userReadsStatusMessage( const QString& contact )
+{
+	QString name;
+	
+	Kopete::Contact * ct = contacts()[ Oscar::normalize( contact ) ];
+	if ( ct )
+		name = ct->nickName();
+	else
+		name = contact;
+	
+	KNotification* notification = new KNotification( "icq_user_reads_status_message" );
+	notification->setText( i18n( "User %1 is reading your status message", name ) );
+	notification->sendEvent();
+}
+
 void ICQAccount::setAway( bool away, const QString &awayReason )
 {
 	kDebug(14153) << k_funcinfo << "account='" << accountId() << "'" << endl;
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/icq/icqaccount.h #604787:604788
@@ -93,6 +93,8 @@
 	void storeUserInfoDialog();
 	void closeUserInfoDialog();
 
+	void userReadsStatusMessage( const QString& contact );
+
 private:
 	bool mWebAware;
 	bool mHideIP;
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/client.cpp #604787:604788
@@ -543,6 +543,7 @@
 		{
 			QTextCodec* codec = d->codecProvider->codecForContact( msg.sender() );
 			response.setText( Oscar::Message::UserDefined, statusMessage(), codec );
+			emit userReadsStatusMessage( msg.sender() );
 		}
 		else
 		{
--- trunk/KDE/kdenetwork/kopete/protocols/oscar/liboscar/client.h #604787:604788
@@ -444,6 +444,7 @@
 	void receivedAwayMessage( const QString& contact, const QString& message );
 	void receivedAwayMessage( const Oscar::Message& message );
 	void receivedUserInfo( const QString& contact, const UserDetails& details );
+	void userReadsStatusMessage( const QString& contact );
 
 	/** We warned a user */
 	void userWarned( const QString& contact, quint16 increase, quint16 newLevel );