Skip navigation
4569 Views 5 Replies Latest reply: Oct 28, 2009 9:15 PM by liujustme RSS
Bronze 2 posts since
Aug 23, 2007
Currently Being Moderated

Dec 12, 2007 2:34 PM

offline file transfer

I posted this a month ago rec'd no response but have since upgraded to

spark 2.5.8 & openfire 3.4.2  still no joy.

 

When we use spark to send to a recipient who is not online:

sender gets the message:

 

The user is offline. Will auto-send "Tunnelier-Inst-4.25.exe" when user comes back online.

 

this message is sometimes repeated even after the receiver logs onto the chat server, but the file is never sent. 

receiver gets: NOTHING

 

The sender's client seems to forget the next day after logoff, overnight then logon.

 

Nothing is logged on the server about the file transfer.

This does not happen with text messages they are delivered once the recipient logs on again.

 

Does anyone have a solution (plugin or other) this is causing some problems for us.

 

Thanks

 

Tricia

  • liujustme Bronze 7 posts since
    Jul 8, 2009
    Currently Being Moderated
    Jul 8, 2009 9:42 PM (in response to Patricia Campbell)
    Re: offline file transfer

    i meet the same problem.

     

    spark2.5.8(spark2.6.0beta2) + opends + mysql + openfire3.6.4

     

    userA,userB have add each other as contact.

     

    userA send a file to userB(offline),and in chat window userA get following message:

     

    The user is offline. Will auto-send "xxx" when user comes back online.

     

    Then userB log in , userA get notification that userB is online, and in userA's contact list, userB's status turns online(gray to green,change from offline group to friend group), but in chat window(previously opened), the userB tab keeps gray,and get the same message

     

    The user is offline. Will auto-send "xxx" when user comes back online.

     

    Nothing is logged on the server and client.

     

    so what's wrong? can anyone help me!

    • elter Bronze 2 posts since
      Jun 19, 2009
      Currently Being Moderated
      Jul 16, 2009 3:16 AM (in response to liujustme)
      Re: offline file transfer

      I meet the same problem too. But a little diffrent. Take notice to the green words.

       

      spark2.5.8(spark2.6.0beta2) + opends + mysql + openfire3.6.4

       

      userA,userB have add each other as contact.

       

      userA send a file to userB(offline),and in chat window userA get following message:

       

      The user is offline. Will auto-send "xxx" when user comes back online.

       

      Then userB log in , userA get notification that userB is online, and in userA's contact list, userB's status is offline(gray to green,change from offline group to friend group), but in chat window(previously opened), the userB tab keeps gray,and get the same message

       

      The user is offline. Will auto-send "xxx" when user comes back online.

       

      • liujustme Bronze 7 posts since
        Jul 8, 2009
        Currently Being Moderated
        Jul 19, 2009 9:03 PM (in response to elter)
        Re: offline file transfer

        hi, i'm not true if i find the solution.

         

        I check the source code, decompile the smack.jar(with spark 2.5.8). I find that:

         

        org.jivesoftware.smack.PacketReader has a field: listerners

         

        protected final Map<PacketListener, ListenerWrapper> listeners = new ConcurrentHashMap<PacketListener, ListenerWrapper>();

         

        the listerners is used to notify all packetListener.

        for example:

        1,org.jivesoftware.spark.filetransfer.SparkTransferManager{

        ......

        private void addPresenceListener() {
                SparkManager.getConnection().addPacketListener(new PacketListener() {

                   public void processPacket(Packet packet) {
                        Presence presence = (Presence)packet;
                        if (presence.isAvailable()) {

                            ......

        }

        ......

        2,org.jivesoftware.smack.Roster

           ......

                PacketFilter rosterFilter = new PacketTypeFilter(RosterPacket.class);
                connection.addPacketListener(new RosterPacketListener(), rosterFilter);
                PacketFilter presenceFilter = new PacketTypeFilter(Presence.class);
                presencePacketListener = new PresencePacketListener();
                connection.addPacketListener(presencePacketListener, presenceFilter);

          ......

         

        Because listerners use Map, not List, so it's unordered. when spark starts up,  1 may been notified before 2. but next time, 2 may before 1.

         

        if 1 before 2, the offline file transfer will get the message:The user is offline. Will auto-send "xxx" when user comes back online

         

        So i change org.jivesoftware.smack.PacketReader,use a ordered Map (ConcurrentSkipListMap)

         

                  protected final Map<PacketListener, ListenerWrapper> listeners =
                    new java.util.concurrent.ConcurrentSkipListMap<PacketListener, ListenerWrapper>(new java.util.Comparator(){
                     public int compare(Object o1, Object o2){
                      return 1;
                     }
                     public boolean equals(Object obj) {
                      return super.equals(obj);
                     }
                    });

         

        compile, then put into smack.jar

         

        I test this , it seem ok.

         

        hehe, i'm not sure if this is the solution. I just want this to be helpful.

        Attachments:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points