Menu

cannot get setDisplayPicture working!

Help
2010-01-03
2013-04-29
1 2 > >> (Page 1 of 2)
  • Alvaro Luis Bustamante

    Hi, the first thing to say, is thanks for share JML, is an awesome and well build library.

    But i have a problem with the setDisplayPicture method of the MsnOwner class.

    I can sign in succesfully with MSNP15 with JML, and later i try to change the owner display picture. I use the following code:

        MsnObject displayPicture = MsnObject.getInstance(myCon.getOwner().getEmail().getEmailAddress(), bout.toByteArray());
        displayPicture.setType(MsnObject.TYPE_DISPLAY_PICTURE);
        myCon.getOwner().setDisplayPicture(displayPicture);

    bout contains a compressed JPG image of 96x96 pixels. I also tried compressing it with PNG but without any success.

    In Windows Live Messenger, the contact image appears to be refreshed due to the NLN command send when calling setDisplayPicture, but no picture is updated.

    Any idea?? i think that i am missing something, but actually i have no idea :S

    Thanks in advance.

     
  • James Lopez

    James Lopez - 2010-01-03

    I have e-mailed jadestorm asking for such issue too, but no response. In the mean time I was trying to fix it without success…

    The easy way to make DP work is to set MSNP10 instead of any MSNP>10
    (this worked for me)

    I am relatively new to the MSN protocol, but what I have noticed talking to an aMSN team member is that there's no DP visible changes between MSNP10 and 11! So it could be easy to patch such thing, as there's no new DP protocol implemented, still MSNSLP invite request is made, etc.
    I was comparing LOG messages between a MSNP10 session and MSNP11 but no luck at the moment..

    Hope this help!

     
  • James Lopez

    James Lopez - 2010-01-03

    Finally I have made it work! but I had modified several things into the JML code, so I'll put a patch later, perhaps tomorrow, with just this issue solved.

    Notice that currently DP works setting protocol to MSNP10.

     
  • Alvaro Luis Bustamante

    Thanks for your response! but…. no luck for me :( is strange. Im using the latest svn trunk version, maybe i should try with the latest release.

    I tried with MSNP 10, 11, 12, 13, 14 and 15 but none worked (SVN version).

    I will try now with the latest jar release and MSNP 10, but i want to manage offline messages of MNSP13… i will tell you what happens with jar version.

    Thanks!

     
  • Alvaro Luis Bustamante

    Wow it sounds great! did you do it with MSNP>10? thx!

     
  • James Lopez

    James Lopez - 2010-01-03

    Yes, I hope it was not a mirage but it worked with MSNP11, I still have to test it with >11

    DP with MSNP10 worked for me with the last SVN check out

    Need to set
    messenger.setSupportedProtocol(new MsnProtocol { MsnProtocol.MSNP10 });

    I have no time now to continue checking, anyway soon I'll post more information :)

     
  • Daniel Henninger

    Howdy!  If you provide a patch I'd love to apply it.  =)  If you don't have time to create a patch and it would be quicker to zip or tarball up your source and email it to me, I can do the diff myself.  Whatever is easiest for you.

     
  • James Lopez

    James Lopez - 2010-01-04

    I've made a patch with my diffs for make DP work with MSNP>10 (and some more things..)

    There're still some issues, anyway as I will continue using the lib, probably I'll upload a better one.
    With this patch I was able to use DP and set my initial personal message and display name with any MSNP>10 but 13, mainly because there's some issue with MSNP13 with a USR reply in the SVN JML version, anyway I didn't checked such issue.

    Note: there're several files modified in the patch

     
  • Alvaro Luis Bustamante

    Hi!! how can i apply this patch?? thx for your work bluegod.

    I also noticed that there are some problems in using JML in the Android platform. im not sure what happens but for example some listeneres are never called (i.e. list contacts sync). I did some modifications in the code to get login work… but it appears to be more incompatibilities :S

     
  • James Lopez

    James Lopez - 2010-01-05

    There're some connection issues that should be solved with this patch, although it's not exactly in the login process but when the user changes his initial status to online/other, and before/after the sync is made.

    To apply the patch you can change to the "jml" directory and do a:
    patch -p0 < jml-dp.patch

    Ex: cd mydir/java-jml/src/net/sf/jml
          patch -p0 < jml-dp.patch

    Notice that the patch still has issues to cover and I was the only one using such changes at the moment with success…

     
  • ronaldo

    ronaldo - 2010-01-06

    Dear bluegod:

    Would you tell me do I need to install some software  for execute this command?

    This is my development environment:

    1. JDK1.6
    2. Windows XP
    3. Eclipse ganymede

    Moreover, does this patch for fixing the display picture problem?
    thank you very much

     
  • Daniel Henninger

    Howdy!  I just applied the patch to trunk - looks great, thanks!!

     
  • James Lopez

    James Lopez - 2010-01-06

    cstsang: I don't use Windows, but there should be a patch utility for Windows users too.. just search in google "diff patch windows xp" or something like that.. Anyway as currently it's merged with trunk, I suggest you to download the last SVN snapshot instead of applying the patch!

    jadestorm no problem! Thank you for the merge! because there's still some issues as far as I know with the contact list, for MSNP>13 long contact lists are not being well processed (before and after the patch), I put some related information in a //TODO at the patched files, anyway If I fix such issue I'll upload other patch later :)

     
  • ronaldo

    ronaldo - 2010-01-10

    hey bluegod,

    Sorry to bother you again, would you tell me how can I set the display picture in MSNP=15?
    Do I need a compressed JPG image of 96x96 pixels?
    Or Do I need to call the setInitDisplayName method to trigger the change of display picture?
    Or anything else?

    Does the lastest SVN coding can support this function?

    thank you

     
  • James Lopez

    James Lopez - 2010-01-10

    Hi,

    Display picture is working for any protocol MSNP>10.. You can use it with MSNP15 or course..
    You should set your initial DP at startup in the initMessenger function, for example:

    MsnObject displayPicture = MsnObject.getInstance(myaccount,"root/to/dp");                                  
    messenger.getOwner().setInitDisplayPicture(displayPicture);
    

    It should be a common MSN DP, like the one it's attached with the SVN JML version, It's in the /resource/UserTile dir I think so..

    I have made a function to load a JPG file too form any HTTP or local file, and I'll will add an auto-resize feature, but this is a class part of a program I'm working on, perhaps I'll merge it to JML, but there are other priority TODO in JML I think!

    This patch was merged to SVN JML version, so currently you may use DP with the last SVN version without problems!

     
  • pgty

    pgty - 2010-01-27

    I had the same problem  ,I use protocol MSNP15

     
  • ronaldo

    ronaldo - 2010-01-27

    I have tested the lastest SVN trunk code, it still cannot display the owner picture.
    Would anyone tell me why?

     
  • James Lopez

    James Lopez - 2010-01-27

    It works fine for me, doing exactly what I have posted in my previous post

     
  • James Lopez

    James Lopez - 2010-01-29

    I answer it here because I prefer to help in the forum rather than e-mail, as there could be people with the same problem and this avoid unnecesary same replies.

    In fact, I have not implement the initMessenger() method.
    Is it necessary to implement this method?

    that is source code:
    http://pastebin.ca/1770059

    Ok, it's not mandatory to implement such method, but you should look at prettymessenger and the other examples available for a quick look on how to connect to MSN.

    Looking at your code it seems that your startup method is called:

      public MsnClient(LoginVO l,ImEvent ie)

    Such method doesn't have the setInitDisplayPicture() method, so the DP is not set

    In fact… Looking at your code you have a method called setInitPhoto() that is never called.

     
  • ronaldo

    ronaldo - 2010-01-30

    In fact, I init the object from a jsp , you may refer the jsp page.

    http://pastebin.ca/1771467

    This is my listener object:

    http://pastebin.ca/1771477

    Although I have tried to call the setInitPhoto()  before and after login ,it still cannot work.
    I verifed that the image path is correct, if the image path is not correct, it will throws an exception.
    I turnned on the logging. However, I got nothing.
    I am using tomcat 6 to run my web msn.

    Would you anyone help me ?

     
  • James Lopez

    James Lopez - 2010-01-30

    You should consider to simplify your code in order to know if the error is in your code, I mean, consider calling the setPicture method inside your MsnClient() method, before adding the listeners…
    Also it would be a good idea to enclose a try/catch in your setPicture method with a log message in order to minimize a load user tile error.

    And by the way, you should try any of the .java examples included, as if they work for you it should be a problem with your code, load path, etc… You should modify the path of the examples to point directly to the path of a PNG file.

     
  • ronaldo

    ronaldo - 2010-01-31

    I have tried to use try/catch to enclose the setPicture method.However, I got nothing.
    By the way, I will try to call the setPicture method before setting any listensers.

     
  • ronaldo

    ronaldo - 2010-01-31

    I simplified the source code and then test again.
    The testing result is still failed.

    Here is my source code:
    http://cstsang.no-ip.com/DP.zip

    Would anyone can help me?

    thank you

     
  • ronaldo

    ronaldo - 2010-02-01

    I test the original example

    i.e.
    PrettyMessenger.java and
    BasicMessenger.java

    in my environment, it cannot working as my expectation.
    It cannot show the display picture and sending the custom emoticon.

     
1 2 > >> (Page 1 of 2)

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.