TReKiE / msnp-sharp

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

Fail to accept friend requests #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Receive a friend request
2. Try to accept it
3. repeat steps 1-2 a few times

What is the expected output? What do you see instead?
User should be able to see the bot online and send messages to it, but they
can't.  After accepting friend, sometimes messages do show up as offline
message even while the bot is online.

What version of the product are you using? On what operating system?
2.5.3 Windows

Please provide any additional information below.
I am running a bot, all i want to do is accept messages and reply saying
"got it".  also want to accept friend requests so they can see the bot
online, but preferably not add them to my list since there would be thousands.

here's a snippet of code where i accept the request, perhaps it is a
problem here:

        void Nameserver_ReverseAdded(object sender, ContactEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke(new
EventHandler<ContactEventArgs>(Nameserver_ReverseAdded), sender, e);
                return;
            }
            Contact contact = e.Contact;
            if (contact.OnAllowedList)
            {
                contact.OnPendingList = false;
            }
            else
            {
                ShowEvent("friend request: " + contact.Mail, true);
                contact.OnAllowedList = true;
            }
            return;

//contact.NSMessageHandler.ContactService.AddNewContact(contact.Mail);
        }

Here's the more detailed problem:  when i get a friend request, they appear
on my pending list.  when i accept it, they remain on my pending list. 
why?  when do i know it's safe to remove them from the pending list? 
sometimes just by saying "OnAllowedList = true", doesn't make it true. 
they might not be, so i can't assume it's safe to remove them from the
pending list.  So I made it when i get a reverseadded, and they are on my
allowed list, i remove them from pending.  this is very confusing and seems
to be a problem with the protocol, not necessarily msnpsharp.   it there a
code example of how to make this reliable? 

Original issue reported on code.google.com by duffy.a...@gmail.com on 6 Feb 2009 at 4:23

GoogleCodeExporter commented 9 years ago
If our database is old, ReverseAdded is fired 2 times - yes, only two times, 
not 3 times
The second ReverseAdded can be ignored, because it is on AL/BL or RL anymore...

Anyway, silly MS$ sometimes arranges the lastchanged memberships on top and this
fires blocked/allows multiple times.
Just do, allow, block, allow, block, allow, block... Now we sort memberships by 
last
changed to process memberships correctly.

Original comment by hepha...@gmail.com on 12 Mar 2009 at 7:06