Cant send offline message if the message type different than chat

103 views
Skip to first unread message

Tolga Tanrıverdi

unread,
Feb 10, 2012, 12:25:47 PM2/10/12
to XMPPFramework
Hello
I'm trying to send messages to users regardless of their presence
(online or offline)
I can do that when I'm sending regular messages with type attribute is
equal to chat (type=chat)
but I ' ve made some customization s and I'm sending messages with
different types such as image,audio etc...(those messages includes
link to image or audio files and additional informations) but I've
figured out that if I send the message with type which is different
than "chat " , it only receives to the online users.
If I try to send it to offline users it doesn't work.
I'm using open fire 3.7.1
Does anyone have any idea about this problem?

Thanks

James Hays

unread,
Feb 10, 2012, 1:57:06 PM2/10/12
to xmppfr...@googlegroups.com
Yes, it's part of the XMPP Spec.

Normal and Chat types are stored offline.  All others are dropped.  A better solution is to probably create a payload-type element within the message stanza and then create a category on the XMPPMessage object in order to handle it.  The benefit here is that all standard clients will know how to display the message, but your client can take it to the next step and display the payload.
For images, I've also used the out of band process for sending images as well instead of a file transfer so that offline users can receive images.

<message from='ro...@montague.net/orchard' to='jul...@capulet.com'>
  <body>
    O blessed, blessed night! I am afeard.
    Being in night, all this is but a dream,
    Too flattering-sweet to be substantial.
  </body>
  <payload type='image'>
    hivpajipadspvjdisapvjdsipvdsjaipvdsajivajipaandOtherTypesOfData...
  </payload>
</message>



--
You received this message because you are subscribed to the Google Groups "XMPPFramework" group.
To post to this group, send email to xmppfr...@googlegroups.com.
To unsubscribe from this group, send email to xmppframewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xmppframework?hl=en.


Tolga Tanrıverdi

unread,
Feb 10, 2012, 4:26:59 PM2/10/12
to xmppfr...@googlegroups.com
Hello James
Can you explain to me  little bit about out of band file transfer and how offline users can receive that files.
I couldn't find any way to do that so I' ve found the solution to transfer the file through ftp server and send the link of that file in the ftp server to the receiving user.


Thanks
Tolga

2012/2/10 James Hays <james...@me.com>

James Hays

unread,
Feb 10, 2012, 7:07:13 PM2/10/12
to xmppfr...@googlegroups.com
Sure.
<message from='stp...@jabber.org/work'
         
to='Main...@jabber.org/home'>
 
<body>Yeah, but do you have a license to Jabber?</body>
 
<x xmlns='jabber:x:oob'>
   
<url>http://www.jabber.org/images/psa-license.jpg</url>
 
</x>
</message>

A URL is sent along with a message, which allows you to dictate the message type.  'Chat' and 'Normal' types are stored for offline delivery so the recipient will simply get it the next time they are available.
This is really meant as a last ditch effort in attempting to transfer a file, but it works really well for mobile XMPP clients where networks can (and frequently do) collapse.

The obvious artifact here is that the item being shared must first be uploaded to a common location (server) that the recipient can download from.  This increases your overhead by having to first upload the item before the OOB message to download can be sent.  I personally found this to be a benefit because I didn't have to worry about two shaky mobile networks for the transfer.  I only had to deal with one at a time and once the item was uploaded, I didn't have to worry about it much.

The end result is a fairly robust way of transferring all types of files.  The downside is, and I haven't found a solid solution to this yet, that I don't have a good way of knowing when I can delete a file from the server.  You could delete it once the file is downloaded, but that didn't work well for our needs.

Hope that helps,
James

Eric Chamberlain

unread,
Feb 11, 2012, 2:42:11 PM2/11/12
to xmppfr...@googlegroups.com
We also use OOB to transfer audio files.

We use a short url that redirects to the audio file in Amazon S3.  We can track the downloads based on the redirect and delete the files if it's been a few days since the last download.
--
Eric Chamberlain, Founder
RingFree Mobility Inc.

Reply all
Reply to author
Forward
0 new messages