[JDEV] id attr in message packets
Sean Wheeler
swheeler at media.mit.edu
Sun Jul 14 12:01:41 CDT 2002
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?
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--
bar
SENT: <message to="foo at media"><id>1</id>...</message>
foo receives
RECV: <message to="foo at media" from="bar at media"><id>1</id>...</message>
and replies
SENT: <message id="1" to="bar at media"><id>2</id>...</message>
so bar might reply
<message id="2" to="foo at media"><id>3</id>...</message>
Has anyone dealt with this problem in a more straightforward way?
Sean
More information about the JDev
mailing list