Bug 288327

Summary: telepathy-text-ui does not reconnect correctly to chatroom
Product: [Frameworks and Libraries] telepathy Reporter: Balcaen John <balcaen.john>
Component: text-uiAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kde, mail
Priority: NOR    
Version: unspecified   
Target Milestone: 0.4.0   
Platform: Mageia RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Balcaen John 2011-12-06 11:15:34 UTC
Version:           unspecified (using KDE 4.7.3) 
OS:                Linux

Currently i have an internet disconnection every 24 hours.
If i'm connected to a xmpp chatroom, telepathy-text-ui disconnect from the chatroom & reconnect automatically but to an « non » existence chatroom :
i'm « alone » on this chatroom & i'm not able to send a message to the chatroom.


Reproducible: Always

Steps to Reproduce:
Connect to a xmpp chatroom,
reconnect to internet 


Actual Results:  
You'll get 2 windows
-> the correct chatroom marked as disconnect
-> a new window with the same chatroom where you're alone & not able to sent any messages

Expected Results:  
You should be able to reconnect to your previous chatroom.

Please note that i'm having a dynamic internet ip.

All of this are tested with mageia cauldron running telepathy-kde 0.2.
Telepathy-gabble is 0.15.1
Comment 1 Martin Klapetek 2012-01-16 15:38:23 UTC
*** Bug 291630 has been marked as a duplicate of this bug. ***
Comment 2 David Edmundson 2012-01-16 15:53:00 UTC
Just looked at the code, error is in:

ChatTab::onConnectionStatusChanged

We need to check the targetHandleType and act appropriately.
Comment 3 David Edmundson 2012-01-16 18:40:53 UTC
Git commit bb2b9dd77f5695bfdf80f98c138aee044ddeff50 by David Edmundson.
Committed on 16/01/2012 at 19:38.
Pushed by davidedmundson into branch 'master'.

Correctly rejoin chatrooms on reconnect

Reviewed by: Martin Klapetek

M  +11   -1    app/chat-tab.cpp
A  +7    -0    app/defines.h     [License: UNKNOWN]  *
M  +3    -1    app/main.cpp

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/telepathy-text-ui/bb2b9dd77f5695bfdf80f98c138aee044ddeff50
Comment 4 Elias Probst 2012-01-16 21:23:15 UTC
Sorry, need to REOPEN.
The committed patch doesn't work here (still doesn't reconnect), while the previous nopasted patch (see below) works just fine.

Just verified by locally reverting to the previous commit and testing the "old" patch again.

diff --git a/app/chat-tab.cpp b/app/chat-tab.cpp
index a8f6626..5a16f45 100644
--- a/app/chat-tab.cpp
+++ b/app/chat-tab.cpp
@@ -80,6 +80,14 @@ void ChatTab::onConnectionStatusChanged(Tp::ConnectionStatus status)
 {
     // request a new text channel for the chat
     if (status == Tp::ConnectionStatusConnected) {
-        account()->ensureTextChat(textChannel()->targetId(), QDateTime::currentDateTime(), QLatin1String("org.freedesktop.Telepathy.Client.KTp.TextUi"));
+        if (textChannel()->targetHandleType() == Tp::HandleTypeContact) {
+            account()->ensureTextChat(textChannel()->targetId(),
+                                      QDateTime::currentDateTime(),
+                                      QLatin1String("org.freedesktop.Telepathy.Client.KTp.TextUi"));
+        } else if (textChannel()->targetHandleType() == Tp::HandleTypeRoom) {
+            account()->ensureTextChatroom(textChannel()->targetId(),
+                                                   QDateTime::currentDateTime(),
+                                                   QLatin1String("org.freedesktop.Telepathy.Client.KTp.TextUi"));
+        }
     }
 }
Comment 5 Martin Klapetek 2012-01-16 21:32:56 UTC
Git commit 5dfed1cf2127e27901bd8c6571cb682674aa0e3a by Martin Klapetek.
Committed on 16/01/2012 at 22:31.
Pushed by mklapetek into branch 'master'.

Use correct string for text-ui client path

M  +1    -1    app/defines.h

http://commits.kde.org/telepathy-text-ui/5dfed1cf2127e27901bd8c6571cb682674aa0e3a
Comment 6 Elias Probst 2012-01-16 21:35:09 UTC
Works now!