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

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!

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.

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.
PacketReader.java.zip (7882 Bytes)

按照你的文件,重新编译smack后,还是老样子啊,不行啊

我就改了PacketReader.java中这一个地方,我这边试了可以。是不是版本的问题?

对了,另外,还有一片帖子是我发的,里面有我的环境说明:

http://www.igniterealtime.org/community/thread/39079,看能否帮上你!