Bug 139418 - jabber: typing notification sent twice
Summary: jabber: typing notification sent twice
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unmaintained
Component: Jabber Plugin (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 156746 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-30 23:53 UTC by Johannes Wienke
Modified: 2009-02-01 00:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Wienke 2006-12-30 23:53:43 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages

Miranda users with some silly plugin that shows a small popup every time a client begins typing, report that the kopete jabber plugin sends every typing notification twice. I've also tested this via ICQ and MSN and these plugins do not have this bug.
Comment 1 Jan Ritzerfeld 2006-12-31 11:52:13 UTC
Sorry, I cannot really reproduce. There is exactly one typing notification sent that indicates that I started typing and exactly one typing notification that I stopped typing. Here is "my" full debug output.

kopete (jabber): [void JabberChatSession::slotSendTypingNotification(bool)] Sending out typing notification (true) to all chat members.
kopete (jabber - raw protocol): [void JabberAccount::slotClientDebugMessage(const QString&)] XML OUT: <message from="xxx@jabber.example.com/Kopete" type="chat" id="ab1fa" to="yyy@jabber.example.com/Miranda" >
<composing xmlns="http://jabber.org/protocol/chatstates"/>
<x xmlns="jabber:x:event">
<id>mir_8</id>
<composing/>
</x>
</message>
kopete (jabber - raw protocol):
kopete (jabber): [void JabberChatSession::slotSendTypingNotification(bool)] Sending out typing notification (false) to all chat members.
kopete (jabber - raw protocol): [void JabberAccount::slotClientDebugMessage(const QString&)] XML OUT: <message from="xxx@jabber.example.com/Kopete" type="chat" id="ab20a" to="yyy@jabber.example.com/Miranda" >
<paused xmlns="http://jabber.org/protocol/chatstates"/>
<x xmlns="jabber:x:event">
<id>mir_8</id>
</x>
</message>
kopete (jabber - raw protocol):
kopete (jabber - raw protocol): [void JabberAccount::slotClientDebugMessage(const QString&)] XML OUT: <message from="xxx@jabber.example.com/Kopete" type="chat" id="ab21a" to="yyy@jabber.example.com/Miranda" >
<body>test</body>
<active xmlns="http://jabber.org/protocol/chatstates"/>
<x xmlns="jabber:x:event">
<offline/>
<composing/>
<delivered/>
<displayed/>
</x>
</message>
Comment 2 Johannes Wienke 2006-12-31 12:05:45 UTC
Strange, how do I get such a protocol?

The friend, how noticed this bug while I was chatting with her, said that other kopete-users also invoke two notifications with that plugin. So there must be something kopete does other what other clients don't do.
Comment 3 Johannes Wienke 2006-12-31 15:26:12 UTC
OK, I found it. After I compiled it with debug-flag (Gentoo) I got this output while typing a sentence:

--------------------

kopete (jabber): [void JabberChatSession::slotSendTypingNotification(bool)] Sending out typing notification (true) to all chat members.
kopete (jabber - raw protocol): [void JabberAccount::slotClientDebugMessage(const QString&)] XML OUT: <message from="languitar@jabber.org/Kopete/Laptop" type="chat" id="ab09a" to="foobar_at_jabber.org/home" >
<composing xmlns="http://jabber.org/protocol/chatstates"/>
<x xmlns="jabber:x:event">
<id>mir_8</id>
<composing/>
</x>
</message>
kopete (jabber - raw protocol):
kopete (jabber): [void JabberChatSession::slotSendTypingNotification(bool)] Sending out typing notification (true) to all chat members.
kopete (jabber - raw protocol): [void JabberAccount::slotClientDebugMessage(const QString&)] XML OUT: <message from="languitar@jabber.org/Kopete/Laptop" type="chat" id="ab0aa" to="foobar_at_jabber.org/home" >
<composing xmlns="http://jabber.org/protocol/chatstates"/>
<x xmlns="jabber:x:event">
<id>mir_8</id>
<composing/>
</x>
</message>
kopete (jabber - raw protocol):
kopete (jabber): [void JabberChatSession::slotSendTypingNotification(bool)] Sending out typing notification (true) to all chat members.
kopete (jabber - raw protocol): [void JabberAccount::slotClientDebugMessage(const QString&)] XML OUT: <message from="languitar@jabber.org/Kopete/Laptop" type="chat" id="ab0ba" to="foobar_at_jabber.org/home" >
<composing xmlns="http://jabber.org/protocol/chatstates"/>
<x xmlns="jabber:x:event">
<id>mir_8</id>
<composing/>
</x>
</message>
kopete (jabber - raw protocol):
kopete (jabber): [void JabberChatSession::slotSendTypingNotification(bool)] Sending out typing notification (false) to all chat members.
kopete (jabber - raw protocol): [void JabberAccount::slotClientDebugMessage(const QString&)] XML OUT: <message from="languitar@jabber.org/Kopete/Laptop" type="chat" id="ab0ca" to="foobar_at_jabber.org/home" >
<paused xmlns="http://jabber.org/protocol/chatstates"/>
<x xmlns="jabber:x:event">
<id>mir_8</id>
</x>
</message>

--------------------

The last notification is the paused-message, which was invoked when I took some time to open the terminal and so on.

I've tried to understand when which message is sent. What I noticed, is that the first one is sent correctly when I begin typing. The ones in between are hard to understand (I think the number is relation with the time I am typing) and the last typing-message is sent directly before the message that I stopped typing.
Comment 4 Jan Ritzerfeld 2006-12-31 23:44:45 UTC
Many thanks for your debug output. You were completely right. Kopete is indeed sending out too many jabber composing events when you are typing for a sufficiently long time. "Too many" because section "5.3 Repetition" of XEP-0085 states that "Even if the user types continuously for a long time (e.g., while composing a lengthy reply), the client MUST NOT send more than one standalone <composing/> notification in a row."

I've made a patch that, among other things, has the drawback of changing the public API of JabberChatSession in order to store the last sent chat state event. :-/ For this reason, I did not commited it ... At least, I'll try to fix the other things first.
Comment 5 Jan Ritzerfeld 2008-01-26 22:17:22 UTC
*** Bug 156746 has been marked as a duplicate of this bug. ***
Comment 6 Tomas Trnka 2009-02-01 00:28:41 UTC
SVN commit 919429 by ttrnka:

Do not send repeated typing notifications.

BUG: 139418



 M  +38 -32    jabberchatsession.cpp  
 M  +6 -4      jabberchatsession.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=919429