mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Fondermann <bf_...@brainlounge.de>
Subject Re: [Vysper] Random thoughts on message stanza handling
Date Thu, 03 Sep 2009 08:36:04 GMT
Niklas Gustavsson wrote:
> On Thu, Sep 3, 2009 at 10:07 AM, Bernd Fondermann<bf_jak@brainlounge.de> wrote:
>>> * How about making MessageStanza.getSubjects() and
>>> MessageStanza.getBodies() return a Map<String, String> rather than
>>> Map<String, XMLElement>? Looking at the XML schema for <message>,
>>> seems that body and subject elements can only contain text.
>> the XML schemas are not normative.
> The text also states the same thing, see for subject:
> http://tools.ietf.org/html/draft-saintandre-rfc3921bis-08#section-5.2.4
> "The <subject/> element MUST NOT contain mixed content".
> For body, the text is probably the same, but is cut of in the document.
>> rather, body elements can actually contain XML, see
>> http://xmpp.org/extensions/xep-0071.html
> Interesting, that means my suggestion would not work. Retracting my
> suggestion :-)

It's probably depending on the xmlns. body with default xmlns can only
contain text.

>>> * Should we add a StanzaBuilder.createMessageStanza() that takes
>>> Map<String, String> for subjects and bodies?
>> we could. but where do we actually create pristine message stanzas?
> Right, might not be all that common.
>>> * Also, how about adding a StanzaBuilder.createMessageStanza() that
>>> takes a Delay object for adding a delay element?
>> What would be the use case, MUC history?
> Yes, exactly. In this case the delayed delivery is quite simple since
> it just a matter of adding on the delay element from the discussion
> history.

So you would need to create a clone of the original message and add a
delay element. Keep in mind that the message might (=will) contain
arbitrary payload which you'd need to carry with you.

If it's simple to add in the MUC case, do it. We can always factor it
out later.

Please note there are utilities for generating XEP conformant date
strings in o.a.v.xmpp.datetime.DateTimeProfile


View raw message