[JDEV] id attr in message packets

Matthew A. Miller linuxwolf at outer-planes.no-ip.COM
Sun Jul 14 12:29:02 CDT 2002


On Sun, 2002-07-14 at 10:01, Sean Wheeler wrote:
> 
> So I'm pretty new to jabber protocol, but one thing has already come up.
> Apologies in advance if this is obvious or has been discussed at length.
> 
> Assume my client "bar at media" sends a message to a counterpart:
> 
> SENT: <message id="1" to="foo at media">...</message>
> 
> Foo receives
> RECV: <message id="1" to="foo at media" from="bar at media">...</message>
> 
> and replies
> SENT: <message id="1" to="bar at media">...</message>
> 
> Preserving the id attribute lets my client "foo" reconstruct that this was
> a reply to outgoing message 1.  However, if "foo" replies to bar, how can
> "bar" reconstruct the reply to its previous outgoing message, since id
> attributes are preserved?

The best way to match a "thread" of messages is to use the "thread"
element.  Your example (from bar at media's perspective) is then converted
to:

SEND (bar at media):
	<message id='msg1' to='foo at media'>
		<thread>123456789</thread>
		<body>What's up?</body>
	</message>

RECV (foo at media):
	<message id='msg1' to='bar at media'>
		<thread>123456789</thread>
		<body>Nothin'. You?</body>
	</message>

SEND (bar at media):
	<message id='msg2' to='foo at media'>
		<thread>123456789</thread>
		<body>Watchin' the game</body>
	</message>

> 
> My workaround in my client is to use both id attributes and id tags in the
> message. A reply promotes the incoming id tag to an attribute, and adds a
> new tag of its own. It's kind of confusing at first, but the scheme is
> like--
> 
Using a tag like this is technically outside of spec, which means that
other clients and components may (at best) ignore this <id/> element, or
(at worst) fail.

For more info on this spec, check out the current IETF RFC drafts:

http://www.jabber.org/ietf/draft-miller-xmpp-core-00.html

> 
> Sean
> 
> 
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
-- 

Matt "Linuxwolf" Miller
e-mail && jid:  linuxwolf at outer-planes.net

- Have you "JABBERed" recently? (http://www.jabbercentral.org/)




More information about the JDev mailing list