[Telepathy-commits] [telepathy-spec/master] Messages: Add rationale for messages being aa{sv} and not (a{sv}aa{sv}) or something

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Oct 21 02:18:55 PDT 2008

 spec/Channel_Interface_Messages.xml |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/spec/Channel_Interface_Messages.xml b/spec/Channel_Interface_Messages.xml
index 086ebea..bf45b02 100644
--- a/spec/Channel_Interface_Messages.xml
+++ b/spec/Channel_Interface_Messages.xml
@@ -221,6 +221,23 @@ USA.</p>
             Message_Part, but clients MUST recover from this error by ignoring
             these keys in the second and subsequent parts.</p>
+          <tp:rationale>
+            <p>Instead of representing messages as aa{sv} where the first
+              dictionary is special (a dictionary of headers), we could have
+              used a signature like (a{sv}aa{sv}) to separate out the headers
+              and the body parts.</p>
+            <p>However, this would make access to the messages more awkward.
+              In Python, the syntax for access to a header field would remain
+              <code>message[0]['message-type']</code>, but access to a body
+              field in the second body part would change from
+              message[2]['content'] to message[1][1]['content']. In GLib,
+              the message would change from being a
+              GPtrArray(GHashTable) to being a
+              GValueArray(GHashTable, GPtrArray(GHashTable)) which is rather
+              inconvenient to dereference.</p>
+          </tp:rationale>
           <p>Well-known keys for the message as a whole, and the corresponding
             value types, include:</p>

More information about the Telepathy-commits mailing list