Menu

Remove / Add friend fails

Help
Ian
2006-10-06
2013-04-29
  • Ian

    Ian - 2006-10-06

    I managed to add a completely new contact with JML, but when removing the same contact these seems to be some errors.

    When the imcoming remove packet arrives JML tries to remove (in IncomingREM) the reference from the contactlist.removeContactByEmail (fails cause the contact.getListNumber() == 0 is not true, it seems to be 11). Also the contact.removeBelongGroup fails (getGroupId() return null). So the removing do not update the contactlist or groups.

    After this when I try to add the same contact the adding fails cause the contact already exists in the messenger contactlist (SimpleMessenger.addFriend, if (contact != null) return;) Even when I shutdown the test and start it again I cant add the contact. The contact seems to be there. But when I start my MSN Messenger and log in there are no contacts in my contact list. When I am adding a new contact with MSN Messenger the MSN Messenger offers me "Select existing contact from my Address Book" and the just removed contact can be found from here!

    I am using the MsnProtocol.MSNP8 version. I tried with the newer protocol versions also, but what it comes to MsnProtocol.MSNP10 or above versios the MsnMessengerListener.exceptionCaught throws NullPointerException. This is because the IncominingREM do not find the right parameter value for the email).

    Overall it seems that there are something wrong with the MSN protocol handling what it comes to removing. And there seems to be something wrong also when adding a contact (cause these "address book alike contacts" cant be added again). Is there some way to move them to forward list?

    I would gladly see an implementation that works in this situation.

    Sincerelly, Ian

     
    • Daniel Henninger

      Aha!  That should be easy to fix.  Thanks for tracking down where the problem was occuring!  What you said above is exactly what I needed to see.  ;D

       
    • Ian

      Ian - 2006-10-09

      I made a following fix (not subversioned) for the addFriend(Email, String) method.

      [SimpleMessenger - subversion release]
      if (contact != null)
         return;

      addFriend(MsnList.FL, email, friendlyName);
      addFriend(MsnList.AL, email, friendlyName);
      [end block]

      [SimpleMessenger - after fix]
      if (contact != null){
         if (!contact.isInList(MsnList.FL)){
            addFriend(MsnList.FL, email, friendlyName);
         }
         if (!contact.isInList(MsnList.AL)){
           addFriend(MsnList.AL, email, friendlyName);
         }
      } else {
         addFriend(MsnList.FL, email, friendlyName);
         addFriend(MsnList.AL, email, friendlyName);
      }
      [end block]

      The addFriend procedure for contacts seems to work now. The problem occured if you had added a contact and then removed it. The contact will remain in MSN NS (as a not subcribed contact) and it is also already in your Java JML () contacts. The add without fix checks if you already have this contact in your contact list and returns without adding them to any specific lists.

      Sincerelly, Ian

       
      • Daniel Henninger

        I have committed this change to SVN.  Thanks!

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.