Closed GoogleCodeExporter closed 9 years ago
I have fixed this..I don't know where is the error so i changed the code like
this:
protected virtual void DispatchMessage(NetworkMessage message)
{
// copy the messageHandlers array because the collection can be
// modified during the message handling. (Handlers are
registered/unregistered)
IMessageHandler[] handlers = MessageHandlers.ToArray();
// now give the handlers the opportunity to handle the message
foreach (IMessageHandler handler in handlers)
{
try
{
//I think the person who first write this make a big mistake, C#
is NOT C++,
//message class passes as reference, one change, all changed.
//Mabe we need to review all HandleMessage calling.
ICloneable imessageClone = (message as NSMessage) as ICloneable;
NSMessage messageClone = imessageClone.Clone() as NSMessage;
if (handler is YIMMessageHandler)
{
YIMMessageHandler ym = (YIMMessageHandler)handler;
int byk =ym.Contacts.Count;
Contact [] lst=new Contact[byk];
ym.Contacts.Keys.CopyTo(lst, 0);
for (int i = 0; i <= lst.Length - 1; i++)
{ //check the mail ID
if (lst[i].Mail.ToUpper() ==
messageClone.CommandValues[0].ToString().ToUpper())
{
handler.HandleMessage(this, messageClone);
break;
}
}
}
else
{
handler.HandleMessage(this, messageClone);
}
}
catch (Exception e)
{
if (HandlerException != null)
HandlerException(this, new ExceptionEventArgs(new
MSNPSharpException("An exception occured while handling a nameserver message.
See
inner exception for more details.", e)));
}
}
}
Original comment by ptvegat...@gmail.com
on 17 Jan 2010 at 3:40
Hi,
Cannot reproduce your problem. I use two YIM accounts, one sign in with Yahoo
Messenger, another sign in with Yahoo Web Messenger. Then I send message to one
of
them via example client, everything is ok.
Could you please provide more details?
Original comment by freezing...@gmail.com
on 18 Jan 2010 at 7:41
Am I used an older version of the msnpsharp? I used the v3.0.1 MSNPSharp.
1. I login from your main app.
2. I received IM From MSN User
3. I received IM From 1st YM User
4. I received IM From 2nd YM User
5. Retry from 2nd point to 4th point for a few times.
6. Then the IM received is shown to our conversation form (Our 1st YM User
Conversation and the 2nd YM User Conversation)
I don't know why, when I try to debug, the textMessageReceived is fired twice.
Thank you...
Original comment by ptvegat...@gmail.com
on 18 Jan 2010 at 10:17
Hi,
I don't know what happened just now. A moment ago, I can accepted IM From YM,
But
Just now, it can't accepted. the Sb_Created Event and textmessagereceived is not
fired.. Then I try used the demo application, the YM user is not offline
eventhough
the YM user is online..
Original comment by ptvegat...@gmail.com
on 18 Jan 2010 at 11:15
Hi,
I don't know what happened..the YM is works well again..:)
Original comment by ptvegat...@gmail.com
on 18 Jan 2010 at 2:03
Original comment by freezing...@gmail.com
on 19 Jan 2010 at 7:58
Fixed.
Original comment by freezing...@gmail.com
on 19 Jan 2010 at 9:55
Original comment by freezing...@gmail.com
on 21 Jan 2010 at 8:02
Original issue reported on code.google.com by
ptvegat...@gmail.com
on 17 Jan 2010 at 3:01