[Standards-JIG] Live Chat extension to Chat States (JEP-0085)
trejkaz at trypticon.org
Tue Jan 4 17:23:24 UTC 2005
On Wed, 5 Jan 2005 03:36, Cedric Vivier wrote:
> <message from="romeo at montague.net/orchard"
> to="juliet at capulet.com/balcony" type="chat">
> ~ <composing xmlns="http://jabber.org/protocol/chatstates">
> ~ <body>I</body>
> ~ </composing>
For practical purposes, that seems like an awful lot of markup to encapsulate
a single character which would need to be sent multiple times in order to
compose a single line of chat. Part of the advantage of composing events
(and the reason IM clients started using them in the first place) is the
bandwidth savings over relaying every character.
Nevertheless if it were to go down this path, you would need more
clarifications around the place.
> 5.8 Composing Body
> When sending a composing notification <composing/> element can include a
> <body/> element.
> A client can then send words (ie. tokens) as the users type them in the
> edit box alongside to composing notifications.
> Clients SHOULD send the last word (delimited by spaces) typed after a
> short delay (500ms for instance) and not send <body/> element at each
> and every letter.
Only the last word? What if the user typed more than one word in that time?
(e.g. fast typer, or pasting from the clipboard)
What if clients disagree on what is considered to be a token? I think it
might be safer to use a character count for this, and enforce the count
attribute in all cases where something is being replaced.
What if the client deletes the first word from the sentence? Do you clear the
whole thing and append the tail?
To rethink this, clearing and appending are both kinds of replacing:
* To clear some characters, you replace them with nothing.
* To append some characters, you replace the zero characters at the
end of the body with those characters.
Perhaps this could be made simpler, then? Mirroring the examples from the
<!-- Inserting the initial text. -->
<body start='0' end='0'>I</body>
<!-- Appending text. -->
<body start='1' end='1'> luv</body>
<!-- Replacing text. -->
<body start='1' end='5'> love</body>
The default for 'start' and 'end' could be 'the end of the current body'.
This would allow more interesting use cases like:
<!-- Replace 'I' with 'you'. -->
<body start='0' end='1'>you</body>
which is a little more consistent, but in the end it's still expensive in
terms of bytes. :-)
Email: Trejkaz Xaoza <trejkaz at trypticon.org>
Web site: http://xaoza.net/
Jabber ID: trejkaz at jabber.zim.net.au
GPG Fingerprint: 9EEB 97D7 8F7B 7977 F39F A62C B8C7 BC8B 037E EA73
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 190 bytes
Desc: not available
More information about the Standards