Hi all,

Alexander Tsvyashchenko and I discussed changes in XEP-136, and we wrote
 them in the XEP. Attached is a diff of the xep-0136.xml, and you can
see the result here:
www.lagaule.org/xep/xep-0136.html

What do you think about that?
Comments are appreciated!

-- 
Yann
diff --git a/extensions/xep-0136.xml b/extensions/xep-0136.xml
index 3c69d40..320a710 100644
--- a/extensions/xep-0136.xml
+++ b/extensions/xep-0136.xml
@@ -40,6 +40,17 @@
     <surname>Tsvyashchenko</surname>
     <email>[email protected]</email>
   </author>
+  <author>
+    <firstname>Yann</firstname>
+    <surname>Leboulanger</surname>
+    <email>[email protected]</email>
+  </author>
+  <revision>
+    <version>1.2</version>
+    <date>2010-01-06</date>
+    <initials>at/yl</initials>
+    <remark><p>Add persistent auto save setting. Add ability to control 
settings per chat session.</p></remark>
+  </revision>
   <revision>
     <version>1.1</version>
     <date>2009-09-23</date>
@@ -183,6 +194,7 @@
       <li>A client determines its user's current default Save Mode and OTR 
Mode, and the Modes for particular contacts.</li>
       <li>A client sets the default Save Mode and OTR Mode.</li>
       <li>A client sets the Save Mode and OTR Mode for a particular 
contact.</li>
+      <li>A client sets the Save Mode for a particular chat session.</li>
     </ol>
   </section2>
   <section2 topic='Preference Syntax' anchor='pref-syntax'>
@@ -192,6 +204,7 @@
       <li>MUST include an &lt;auto/&gt; element that specifies whether 
automatic archiving is on or off.</li>
       <li>MUST include a &lt;default/&gt; element that specifies the user's 
default settings for OTR Mode and Save Mode.</li> 
       <li>MAY include one or more &lt;item/&gt; elements that specify 
preferences related to particular contacts.</li>
+      <li>MAY include one or more &lt;session/&gt; elements that specifies 
whether automatic archiving is on or off for a given chat session.</li>
       <li>MUST include at least three &lt;method/&gt; elements, differentiated 
by the value of the 'type' attribute (i.e., at least one &lt;method/&gt; 
element each for "auto", "local", and "manual").</li>
     </ul>
     <p>An example follows.</p>
@@ -202,6 +215,7 @@
     <default expire='31536000' otr='concede' save='body'/>
     <item jid='[email protected]' otr='require' save='false'/>
     <item expire='630720000' jid='[email protected]' otr='forbid' 
save='message'/>
+    <session thread='ffd7076498744578d10edabfe7f4a866' save='body'/>
     <method type='auto' use='forbid'/>
     <method type='local' use='concede'/>
     <method type='manual' use='prefer'/>
@@ -210,7 +224,12 @@
     ]]></example>
     <section3 topic='Auto Element' anchor='pref-syntax-auto'>
       <p>The &lt;auto/&gt; element specifies the current <link 
url='#auto'>Automatic Archiving</link> settings for <em>this stream</em>.</p>
-      <p>This element MUST be empty and MUST include a boolean 'save' 
attribute &BOOLEANNOTE; that specifies whether automatic archiving is enabled 
or disabled for this stream.</p>
+      <p>This element MUST be empty and MUST include a boolean 'save' 
attribute &BOOLEANNOTE; that specifies whether automatic archiving is enabled 
or disabled for this stream. The element MAY include a 'scope' attribute that 
specifies how long this setting is true. The allowable values are:</p>
+        <ul>
+          <li>global -- the setting will remain for next streams.</li>
+          <li>stream -- the setting is true only until the end of the stream. 
For next stream, server default value will be used.</li>
+        </ul>
+        <p>Note: If 'scope' attribute is not set, it SHOULD be considered as 
'stream'.</p>
     </section3>
     <section3 topic='Default Element' anchor='pref-syntax-default'>
       <p>The &lt;default/&gt; element specifies the default settings for both 
OTR Mode and Save Mode. The element MUST be empty and MUST include an 'otr' 
attribute and a 'save' attribute. The element MAY include an 'expire' 
attribute.</p>
@@ -273,6 +292,28 @@
         <p>* Note: The upload, retrieval and management of 'stream' archives 
is <em>currently</em> beyond the scope of this document.</p>
       </section4>
     </section3>
+    <section3 topic='Session Element' anchor='pref-syntax-session'>
+      <p>The &lt;session/&gt; element specifies the settings for Save Mode 
with regard to a particular chat session. The element MUST be empty and MUST 
include a 'thread' attribute, and a 'save' attribute. The element MAY include a 
'timeout' attribute.</p>
+      <p>Server implementations SHOULD remove all &lt;session/&gt; elements 
when stream is closed.</p>
+      <section4 topic='timeout Attribute' anchor='pref-syntax-timeout'>
+        <p>The 'timeout' attribute indicates how long this rule will stay in 
server after the latest message in this thread is exchanged. Server MUST NOT 
forget this rule before 'timeout' seconds after latest message in this thread 
is exchanged but MAY keep this rule longer than 'timeout' value specifies.</p>
+        <p>Client MUST NOT set this attribute, but wait for server's answer to 
know this value.</p>
+       <p>If the client wants to keep this rule longer, it must send a new 
&lt;session/&gt; element to the server before this timeout expires.</p>
+      </section4>
+      <section4 topic='thread Attribute' anchor='pref-syntax-thread'>
+        <p>The 'thread' attribute specifies the ThreadID of the chat session 
(in the sense of &xep-0155;) to which the preferences specified in this 
&lt;session/&gt; element apply.</p>
+      </section4>
+      <section4 topic='save Attribute' anchor='pref-syntax-session-save'>
+        <p>The 'save' attribute specifies the user's setting for Save Mode 
with regard to the specified chat session. The allowable values are:</p>
+        <ul>
+          <li>body -- the saving entity SHOULD save only &BODY; elements.</li>
+          <li>false -- the saving entity MUST save nothing.</li>
+          <li>message -- the saving entity SHOULD save the full XML content of 
each &MESSAGE; element.</li>
+          <li>stream -- the saving entity SHOULD save every byte that passes 
over the stream in either direction. *</li>
+        </ul>
+        <p>* Note: The upload, retrieval and management of 'stream' archives 
is <em>currently</em> beyond the scope of this document.</p>
+      </section4>
+    </section3>
     <section3 topic='Method Element' anchor='pref-syntax-method'>
       <p>Each &lt;method/&gt; element specifies the the user's preferences for 
one available archiving method. The &lt;method/&gt; element MUST be empty and 
MUST include both the 'type' and 'use' attributes.</p>
       <section4 topic='type Attribute' anchor='pref-syntax-method-type'>
@@ -308,6 +349,7 @@
     <default expire='31536000' otr='concede' save='body'/>
     <item jid='[email protected]' otr='require' save='false'/>
     <item expire='630720000' jid='[email protected]' otr='forbid' 
save='message'/>
+    <session thread='ffd7076498744578d10edabfe7f4a866' save='body'/>
     <method type='auto' use='forbid'/>
     <method type='local' use='concede'/>
     <method type='manual' use='prefer'/>
@@ -319,6 +361,7 @@
       <li>By default, message bodies should be saved (according the preferred 
method specified later), communications may be off the record if requested, and 
any saved messages should be expired after 1 year.</li>
       <li>When communicating with [email protected], both entities must not 
save messages and all communications must be off the record.</li>
       <li>When communicating with [email protected], both entities should 
save full messages, communications must not be off the record, and any saved 
messages should be expired after 20 years.</li>
+      <li>Message bodies in thread ffd7076498744578d10edabfe7f4a866 should be 
saved.</li>
       <li>Server-side archiving must not occur automatically.</li>
       <li>Local archiving may be used if requested.</li>
       <li>Manual server-side archiving is preferred.</li>
@@ -405,10 +448,48 @@
 <iq type='result' id='remove1' to='[email protected]/chamber'/>
     ]]></example>
   </section2>
+  <section2 topic='Setting Modes for a Chat Session' anchor='pref-session'>
+         <p>A client may use a similar protocol to set the Modes for a 
particular chat session. A chat session is identified by its unique 'thread' 
attributes in &lt;message&gt; stanza (see &xep0155;)</p>
+    <example caption='Client Sets Modes for a Chat Session'><![CDATA[
+<iq type='set' id='pref4'>
+  <pref xmlns='urn:xmpp:archive'>
+    <session thread='ffd7076498744578d10edabfe7f4a866' save='body' 
otr='concede'/>
+  </pref>
+</iq>
+    ]]></example>
+    <example caption='Server Acknowleges Change'><![CDATA[
+<iq type='result' id='pref4' to='[email protected]/chamber'/>
+    ]]></example>
+    <example caption='Server Pushes New Modes'><![CDATA[
+<iq type='set' id='push5' to='[email protected]/chamber'>
+  <pref xmlns='urn:xmpp:archive'>
+    <session thread='ffd7076498744578d10edabfe7f4a866' save='body' 
timeout='3600' otr='concede'/>
+  </pref>
+</iq>
+
+<iq type='set' id='push6' to='[email protected]/pda'>
+  <pref xmlns='urn:xmpp:archive'>
+    <session thread='ffd7076498744578d10edabfe7f4a866' save='body' 
timeout='3600' otr='concede'/>
+  </pref>
+</iq>
+    ]]></example>
+    <p>The same error cases apply as when <link url='#auto'>Setting Default 
Modes</link>.</p>
+    <p>In order to remove a preference for a chat session, the client shall 
send an &lt;sessionremove/&gt; element to the server.</p>
+    <example caption='Client Removes Preferences for a Contact'><![CDATA[
+<iq type='set' id='remove2'>
+  <sessionremove xmlns='urn:xmpp:archive'>
+    <session thread='ffd7076498744578d10edabfe7f4a866'/>
+  </sessionremove>
+</iq>
+    ]]></example>
+    <example caption='Server Acknowleges Change'><![CDATA[
+<iq type='result' id='remove2' to='[email protected]/chamber'/>
+    ]]></example>
+  </section2>
   <section2 topic='Setting Archiving Method Preferences' anchor='pref-archive'>
     <p>The client can set one or more method preferences by sending an IQ-set 
containing a &lt;pref/&gt; element that in turn contains one or more 
&lt;method/&gt; elements.</p> 
     <example caption='Client Sets Method Preferences'><![CDATA[
-<iq type='set' id='pref4'>
+<iq type='set' id='pref5'>
   <pref xmlns='urn:xmpp:archive'>
     <method type='auto' use='concede'/>
     <method type='local' use='forbid'/>
@@ -417,11 +498,11 @@
 </iq>
     ]]></example>
     <example caption='Server Acknowleges Change'><![CDATA[
-<iq type='result' id='pref4' to='[email protected]/chamber'/>
+<iq type='result' id='pref5' to='[email protected]/chamber'/>
     ]]></example>
     <p>If the client includes less than three &lt;method/&gt; elements, the 
server MUST NOT modify the unspecified methods and MUST leave them as currently 
stored on the server. However, when the server pushes the method preferences it 
MUST include all of the preferences, not only those that were set by the 
client.</p>
     <example caption='Server Pushes New Method Preferences'><![CDATA[
-<iq type='set' id='push5' to='[email protected]/chamber'>
+<iq type='set' id='push7' to='[email protected]/chamber'>
   <pref xmlns='urn:xmpp:archive'>
     <method type='auto' use='concede'/>
     <method type='local' use='forbid'/>
@@ -429,7 +510,7 @@
   </pref>
 </iq>
 
-<iq type='set' id='push6' to='[email protected]/pda'>
+<iq type='set' id='push8' to='[email protected]/pda'>
   <pref xmlns='urn:xmpp:archive'>
     <method type='auto' use='concede'/>
     <method type='local' use='forbid'/>
@@ -442,8 +523,16 @@
     <p>Most archiving preferences are designed for interpretation only by the 
client. The server MUST NOT take into account any of the archiving preferences 
when server administration policies <em>require</em> that every message is to 
be logged automatically. Otherwise, the server MUST interpret the following 
archiving preferences (and SHOULD NOT interpret any other ones):</p>
     <ol>
       <li>The &lt;auto/&gt; element.</li>
-      <li>When performing automatic archiving: the 'save' attribute of the 
&lt;default&gt; element, and the 'jid' and 'save' attributes of the 
&lt;item&gt; element.</li>
+      <li>When performing automatic archiving: the 'save' attribute of the 
&lt;default&gt; element, the 'jid' and 'save' attributes of the &lt;item&gt; 
element, and the 'thread' and 'save' attributes of the &lt;session&gt; element. 
See <link url='#pref-precedence'>Preferences precedence rules</link> for 
details.</li>
       <li>When performing expiration of old messages: the 'jid' and 'expire' 
attributes of the &lt;item&gt; element.</li>
+      <li>When performing expiration of old rules: the 'thread' and 'timeout' 
attributes of the &lt;session&gt; element.</li>
+    </ol>
+  </section2>
+  <section2 topic='Preferences precedence rules' anchor='pref-precedence'>
+    <p>When determining archiving preferences for a given message, the 
following rules shall apply:</p>
+    <ol>
+      <li>'save' value is taken from the &lt;session&gt; element that matches 
the conversation, if present, else from the &lt;item&gt; element that matches 
the contact (see <link url='#impl-jidmatch'>JID Matching</link>), if present, 
else from default element.</li>
+      <li>'otr' and 'expire' value are taken from the &lt;item&gt; element 
that matches the contact (see <link url='#impl-jidmatch'>JID Matching</link>), 
if present, else from default element.</li>
     </ol>
   </section2>
 </section1>
@@ -551,6 +640,7 @@
     <p>If a user's OTR preference for a contact changes during a Chat Session 
that has been negotiated with the contact, and if the new preference would 
affect the value of the 'logging' field that was previously negotiated, then 
the client MUST immediately renegotiate the 'logging' field according to the 
user's new OTR preference (or terminate the Chat Session).</p>
   </section2>
   <section2 topic='Notes' anchor='otr-notes'>
+    <p>If a Stanza Session Negotiation result differ from current preferences 
of archiving for the contact (negotiation agreed to enable OTR and current 
'save' value for this contact is <em>not</em> 'false', or negotiation agreed to 
disable OTR and current 'save' value for this contact is 'false'), the client 
MUST send a new &lt;session/&gt; element with the corresponding 'thread' 
attribute to the server to inform it to save or not the session.</p>
     <p>If a Stanza Session Negotiation agreed to enable OTR then the clients 
MUST NOT allow messages sent in <em>either</em> direction to be archived in any 
way (including <link url='#manual'>Manual Archiving</link> and <link 
url='#auto'>Automatic Archiving</link>). <note>If a client (or user) acts in 
bad faith then its contacts cannot prevent it from archiving 
conversations.</note></p>
     <p>If a Stanza Session Negotiation agreed to enable OTR then both clients 
MUST ensure that the Stanza Session Negotiation messages themselves are not 
archived. For example, if <link url='#auto'>Automatic Archiving</link> was 
enabled when the client received the initial Stanza Session Negotiation 
request, then the client MUST immediately ask its server to delete its copy of 
the request (see <link url='#manage-remove'>Removing a Collection</link> for a 
description of how to remove the messages currently being recorded by the 
server).</p>
   </section2>
@@ -790,7 +880,7 @@
   ]]></example>
   <p>Otherwise:</p>
   <ul>
-    <li>Automatic archiving MUST default to disabled when each stream is 
opened.</li>
+         <li>Automatic archiving MUST default to enabled or disabled when each 
stream is opened according to the last value of &lt;auto/&gt; element if 
'scope' was set to 'global' (see <link url='#pref-syntax-auto'>Auto 
element</link>), else Automatic archiving MUST default disabled.</li>
     <li>A client MAY enable or disable automatic archiving for messages sent 
over its stream at any time. Note: If the client switches off all 
auto-archiving then the server MUST close and archive all active 
collections.</li>
     <li>Once automatic archiving is switched on then the server MUST 
automatically archive messages only according to the user's <link 
url='#pref'>Archiving Preferences</link>.</li>
     <li>Note: Both parties to an ESession (see &xep0116;) SHOULD either 
disable archiving or use an archiving method other than automatic, since 
ESession decryption keys are short-lived -- making it impossible to decrypt 
automatically archived messages.</li>
@@ -977,7 +1067,7 @@
     ]]></example>
     <p>The client MAY remove several collections at once. The 'start' and 
'end' elements MAY be specified to indicate a date range. The 'with' attribute 
MAY specify JID of XMPP entities, see the <link url='#impl-jidmatch'>JID 
Matching</link> section of this document.</p>
     <example caption='Removing all collections with a specified bare JID 
between two times'><![CDATA[
-<iq type='set' id='remove2'>
+<iq type='set' id='remove3'>
   <remove xmlns='urn:xmpp:archive'
           with='[email protected]'
           start='1469-07-21T02:00:00Z'
@@ -987,7 +1077,7 @@
     <p>If the 'with' attribute is omitted then collections with any JID are 
removed.</p>
     <p>If the end date is in the future then all collections on or after the 
start date are removed.</p>
     <example caption='Removing all collections after a date'><![CDATA[
-<iq type='set' id='remove3'>
+<iq type='set' id='remove4'>
   <remove xmlns='urn:xmpp:archive'
           start='1469-07-21T02:00:00Z'
           end='2038-01-01T00:00:00Z'/>
@@ -995,27 +1085,27 @@
     ]]></example>
     <p>If the start date is before all the collections in the archive then all 
collections prior to the end date are removed.</p>
     <example caption='Removing all collections before a date'><![CDATA[
-<iq type='set' id='remove4'>
+<iq type='set' id='remove5'>
   <remove xmlns='urn:xmpp:archive'
           start='0000-01-01T00:00:00Z'
           end='1469-07-21T04:00:00Z'/>
 </iq>
     ]]></example>
     <example caption='Removing all collections'><![CDATA[
-<iq type='set' id='remove5'>
+<iq type='set' id='remove6'>
   <remove xmlns='urn:xmpp:archive'/>
 </iq>
     ]]></example>
     <p>If the value of the optional 'open' attribute is set to 'true' then 
only collections that are currently being recorded automatically by the server 
(see <link url='#auto'>Automatic Archiving</link>) are removed.</p>
     <example caption='Removing a collection being recorded by the 
server'><![CDATA[
-<iq type='set' id='remove6'>
+<iq type='set' id='remove7'>
   <remove xmlns='urn:xmpp:archive'
           with='[email protected]/chamber'
           open='true'/>
 </iq>
     ]]></example>
     <example caption='Removing all collections being recorded by the 
server'><![CDATA[
-<iq type='set' id='remove7'>
+<iq type='set' id='remove8'>
   <remove xmlns='urn:xmpp:archive'
           open='true'/>
 </iq>

Reply via email to