Menu

Problems with removing

Help
2006-10-30
2013-04-29
  • Damian Minkov

    Damian Minkov - 2006-10-30

    Hi,

    On the SIP-Communicator project (http://sip-communicator.org/) we are now implementing the msn protocol
    and using java-jml. But I've encountered some problems.

    I've made some tests with the last SVN version and I found these problems.
    1. IncomingREM - Does not detect when user is removed from a group
    2. IncomingREM - when removing buddy a NullPointerException is thrown.
    java.lang.NullPointerException
         at net.sf.jml.protocol.incoming.IncomingREM.getId(IncomingREM.java:65)
         at net.sf.jml.protocol.incoming.IncomingREM.messageReceived(IncomingREM.java:92)
    As there is no email in the incoming REM message only the id of the contact is there. The incoming message is :
    REM 8 FL dcf1cb9e-c941-42ee-a0cb-39f887e64df7
    3. When incoming IncomingADG is received the getting of parameters groupID and groupName are not correct
    4. The same as 3 but for incoming packet IncomingREG

    Correct me if I am wrong. I will fixed them locally. Should I post the fixes ?

     
    • Damian Minkov

      Damian Minkov - 2006-10-30

      Hi again.
      Obviously these problems are for versions of MSN protocol greater then/and version 10.

       
    • Daniel Henninger

      If you fix these issues, please please post the fixes!  I started working on the remove functionality and got pulled away to other things and haven't had time to finish it yet.  =/  It's actually one of the biggest issues right now and if you end up fixing it and sending something my way, I'll aim to put out a new release ASAP!

      BTW!  Would you like to have your project listed on http://java-jml.sf.net/?

       
    • Damian Minkov

      Damian Minkov - 2006-10-30

      Yes list our project in your web site. Here are the chnages which I made. I've tested them but if there are some problems - any suggestions are welcome :))

      1. IncomingADG
          public String getGroupName() {
              if (protocol.before(MsnProtocol.MSNP10)) {
                  return StringUtils.urlDecode(getParam(1));
              }
              return StringUtils.urlDecode(getParam(0));
          }
          public String getGroupId() {
              if (protocol.before(MsnProtocol.MSNP10)) {
                  return StringUtils.urlDecode(getParam(2));
              }
              return getParam(1);
          }

      2.IncomingREG
          public String getGroupId() {
              if (protocol.before(MsnProtocol.MSNP10)) {
                  return getParam(1);
              }
              return getParam(0);
          }
          public String getGroupName() {
              if (protocol.before(MsnProtocol.MSNP10)) {
                  return StringUtils.urlDecode(getParam(2));
              }
              return StringUtils.urlDecode(getParam(1));
          }

      3.IncomingREM
          public Email getEmail() {
              if (protocol.before(MsnProtocol.MSNP10)) {
                  return Email.parseStr(getParam(2));
              }
              if(getList() == MsnList.AL)
                  return Email.parseStr(getParam(1));
              else
                  return null;
          }
          public String getId() {
              if (protocol.before(MsnProtocol.MSNP10)) {
                  return getEmail().getEmailAddress();
              }
              return getParam(1);
          }
      And in method messageReceived(MsnSession session)
      Replaced the following :
                  MsnContactImpl contact = (MsnContactImpl) contactList
                          .getContactById(getId());

      with
                  MsnContactImpl contact = null;
                  if(list == MsnList.AL)
                      contact = (MsnContactImpl)
                          contactList.getContactByEmail(getEmail());
                  else
                      contact = (MsnContactImpl) contactList.getContactById(getId());

      I think thats it.

       
      • Daniel Henninger

        Hey!  One question:

        In #1, you have:
        public String getGroupId() {
        if (protocol.before(MsnProtocol.MSNP10)) {
        return StringUtils.urlDecode(getParam(2));
        }
        return getParam(1);
        }

        Is there any reason why the first one is a urlDecode instead of just a getParam(2)?  Like was that on purpose?  =)

         
    • Damian Minkov

      Damian Minkov - 2006-10-30

      No copy paste mistake, must be just getParam :)) sorry

       
      • Daniel Henninger

        No problem!  And thanks for the fixes!  =)  I committed them about 2 hours ago.  =D

         
    • Damian Minkov

      Damian Minkov - 2006-10-31

      Hi again.
      there was some problem in the code you comitted.
      Must be :
      IncomingREG
      public String getGroupId() {
          if (protocol.before(MsnProtocol.MSNP10)) {
              return getParam(1);
          }
          return getParam(0);
      }

      but in the svn repository its
         47     public String getGroupId() {
         48         if (protocol.before(MsnProtocol.MSNP10)) {
         49             return getParam(0);
         50         }
         51         else {
         52             return getParam(1);
         53         }
         54     

       
      • Daniel Henninger

        Ack!  Thanks!  Submitted fix.  =)

         
    • Damian Minkov

      Damian Minkov - 2006-11-08

      One more fix :))
      in IncomingRMG
          public String getGroupId() {
              if (protocol.before(MsnProtocol.MSNP10)) {
                  return getParam(1);
              }
              return getParam(0);
          }

       
      • Daniel Henninger

        Thanks!  SVN update pending.  =)

         

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.