[JDEV] id attr in message packets

Jeremy Nickurak atrus at jabber.spam.rifetech.com
Sun Jul 14 13:00:48 CDT 2002


Someone correct me if I'm wrong:

The ID attribute should be preserved for sending and receipt of the
first message, but it need not (and probabbly should not) be preserved in the reply. (Keeping the id in the reply as a default behavior would likely lead to keeping the same id in the reply to the reply, which would man bar at media would be sending multiple messages with the same id)

Eg:

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="2" to="bar at media">...</message>

The id attribute is intended to be used so that the sender and receiver
can refer to particular messages. For example, someone might implement a
"addendum" message type/namespace that changes some element of the
previous message:

<message id="3" type="addendum" from="bar at media" to="foo at media">
   <x xmlns="jabber:x:addendum">
      <append id="1">
         See also http://somepage.com/ for more details.
      </append>
   </x>
</message>

That way, the <append> tag's "id" attribute can be uniquesly associated
with a particular mesage bar at media has already sent to foo at media.

As far as identifying replies & topics, I believe what you're looking
for is the standard message's <thread> tag.


On Sun, 2002-07-14 at 11: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?
> 
> 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
-- 
Jeremy Nickurak -= Email/Jabber: atrus at rifetech.com =-
Mary had a crypto key, she kept it in escrow,
and everything that Mary said, the Feds were sure to know.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://www.jabber.org/jdev/attachments/20020714/ae2d21ac/attachment-0002.pgp>


More information about the JDev mailing list