emesene / emesene-supported-plugins

set of plugins supported by the emesene team
http://www.emesene.org
15 stars 11 forks source link

Last Said: Messages from another conversation after logout/login #57

Closed Stiveknx closed 12 years ago

Stiveknx commented 12 years ago

Here's the case: When you logout and login in again, last said loads the conversations, if you have more than one window open, he shows last conversations from another conversation in that window and vice-versa.

Here's the screenshot, trying to explain:

http://i.minus.com/jD9gQeJJPABCi.png http://i.minus.com/jbtZ5Zt6JznCJV.png

Sbte commented 12 years ago

@pepeleproso, maybe you know a better way, but the only way I see is adding *args to self.session.logger.get_chats and passing that back to the callback...

pepeleproso commented 12 years ago

I think that's the better solution, will make a patch later

Sbte commented 12 years ago

@pepeleproso, a better solution is probably defining the _on_chats_ready method as function inside the _on_started_message method. That way you can still access the conversation variable as set in _on_started_message in the _on_chats_ready function. Some small testing application showed it works for me, but I'm not sure if it works here too.

Sbte commented 12 years ago

@pepeleproso, even easier, I think you could just use a Queue instead of a list. This is what the logger uses, and that is the reason why the conversations are in reverse order. Lists are LIFO and Queues FIFO

pepeleproso commented 12 years ago

please test if the fix works for you

Stiveknx commented 12 years ago

Fixed this bug, but now, the messages are loaded 2 times (the first time it's the conversation and the second it's when the plugin loads the messages again) ...

http://i.minus.com/ipe87R0Ll2gQb.png

I think the plugin shouldn't load the conversations if you got disconnected and connect again ... Cause you have the conversation open you won't loose the text, it's useful only when you open a new conversation ;s

Sbte commented 12 years ago

Maybe we just should call self.new_conversation(cid, [account]), but self.reuse_conversation(cid, [account) in renew_session in gui/base/ConversationManager.py. That is, unless after_new_conversation has to be called, but I don't think so. I'll push a fix to emesene.

Sbte commented 12 years ago

Fix pushed to emesene

Stiveknx commented 12 years ago

Fixed.

Stiveknx commented 12 years ago

@Sbte You open an conversation, than you click in contact name again on contact list, the same problem from my last comment happend, maybe you can do the same thing you did with reuse_conversation when you open a conversation from contact list when the conversation already exists ...

Sbte commented 12 years ago

Fixed