TReKiE / msnp-sharp

Automatically exported from code.google.com/p/msnp-sharp
0 stars 0 forks source link

Conversation.Switchboard.IsSessionEstablished is always false (bug in DotMSNClient) #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect to msn
2. open a conversation window
3. Flood (15-20 messages before the session can be established)

What is the expected output? What do you see instead?
I expect all my messages to arrive, but if I do this the session is never 
established, so my messages are enqueued instead of being sent directly

What version of the product are you using? On what operating system?
2.5.4, Windows Vista

Please provide any additional information below.
When a text message is sent, the method ReInvite(); is always called. 
This method recreate a new conversation if the session isn't established. 
It shouldn't be done like this, because if I send 2 messages before the 
session is established, the second will recreate a conversation, while it 
just has to be enqueued in the first one.

In my client, I don't do it the same way :
When I send a text message, I check if a conversation exists.
If it exists, it's ok
If it doesn't exist, I create a new one

THEN - I check if the session is established :
if it is, I send the message, else I enqueue it.

And on the Switchboard.SessionClosed event, I delete my existing 
conversation
So the next time I wan't to send a message, the conversation doesn't exist 
and a new one will be created.

You could think it's not important as it is only a test client, but I'm 
pretty sure the MSNPsharp users look at this code when they create their 
clients (that's what I did)  ;-)

Original issue reported on code.google.com by adh...@gmail.com on 18 Feb 2009 at 10:18

GoogleCodeExporter commented 9 years ago
Hi,

Would you like to join the project?

Original comment by hepha...@gmail.com on 18 Feb 2009 at 1:00

GoogleCodeExporter commented 9 years ago
No need to join the project, I just changed 2 lines in ConversationForm.cs

In the method ReInvite() :
 if (_conversation == null || !Conversation.Switchboard.IsSessionEstablished)
becomes
 if (_conversation == null)

and in the method Switchboard_SessionClosed, we just add :
_conversation = null;

I didn't test it very deeply, I hope the conversation isn't used anywhere else 
when 
the session is closed.
Anyway, the ReInvite has to send -1 only when the session has been opened and 
closed, and not before the session is fully established

Original comment by adh...@gmail.com on 18 Feb 2009 at 2:21

Attachments:

GoogleCodeExporter commented 9 years ago
Ok, Fixed. Thank you.

Original comment by hepha...@gmail.com on 18 Feb 2009 at 3:28