summaryrefslogtreecommitdiff
path: root/spec/Protocol_Interface_Addressing.xml
blob: 55ee71cb0e168efa64e77553deb59e844fb87e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<?xml version="1.0" ?>
<node name="/Protocol_Interface_Addressing"
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">

  <tp:copyright>Copyright © 2010 Collabora Ltd.</tp:copyright>
  <tp:license xmlns="http://www.w3.org/1999/xhtml">
    <p>This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
      License as published by the Free Software Foundation; either
      version 2.1 of the License, or (at your option) any later version.</p>

    <p>This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Lesser General Public License for more details.</p>

    <p>You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the Free Software
      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
      02110-1301, USA.</p>
  </tp:license>

  <interface
     name="org.freedesktop.Telepathy.Protocol.Interface.Addressing">
    <tp:added version="0.25.1">(as stable API). From the draft,
      NormalizeURI was renamed to NormalizeContactURI, clarifying that
      it removes any actions from the URI.</tp:added>
    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>An interface for protocols that support multiple forms of
        addressing contacts, for example through vCard addresses and URIs.</p>

      <p>If the ConnectionManager has a <tt>.manager</tt> file, and it
        supports this interface, the interface's immutable properties
        must be represented in the file; the representation is described as
        part of the documentation for each property.</p>

      <p>For instance, a SIP connection manager might have the
        following lines in the <tt>.manager</tt> file.</p>

<pre>
[Protocol sip]
AddressableVCardFields=tel;x-sip;
AddressableURISchemes=tel;sip;
</pre>
    </tp:docstring>

    <property name="AddressableVCardFields"
              tp:name-for-bindings="Addressable_VCard_Fields"
              access="read" type="as">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>The vCard fields that can be used to request a contact with
          normalized to lower case. If the <code>URL</code> vCard
          field is addressable, a colon, followed by the supported URI
          schemes will be concatenated.</p>

          <p>For example: <code>["tel", "x-sip"]</code>.</p>

          <p>The <code>url</code> vCard field MUST NOT appear here; see
            <tp:member-ref>AddressableURISchemes</tp:member-ref> instead.</p>

          <tp:rationale>
            <p>In practice, protocols have a limited set of URI
              schemes that make sense to resolve as a contact.</p>
          </tp:rationale>

        <p>Connection managers with a <code>.manager</code> file
          MUST cache this property in the protocol's section of the
          <code>.manager</code> file if it is non-empty, using the key
          <code>AddressableVCardFields</code>. The corresponding value
          is a list of strings, each followed with a semicolon and in the
          syntax of the "localestring" type from the Desktop Entry
          Specification.</p>

        <p>Well-known vCard fields:</p>

        <dl>
          <dt><code>tel</code></dt>
          <dd>The TEL vCard field. Used for phone numbers.</dd>
          <dt><code>x-sip</code></dt>
          <dd>The X-SIP vCard field. Used for SIP addresses.</dd>
          <dt><code>x-aim</code></dt>
          <dd>The X-AIM vCard field. Used for AIM user IDs.</dd>
          <dt><code>x-icq</code></dt>
          <dd>The X-ICQ vCard field. Used for ICQ UINs.</dd>
          <dt><code>x-skype</code></dt>
          <dd>The X-SKYPE vCard field. Used for Skype user names or
          telephone numbers. There is also a X-SKYPE-USERNAME field,
          but for Telepathy purposes, <code>x-skype</code> is preferred</dd>
          <dt><code>x-groupwise</code></dt>
          <dd>The X-GROUPWISE vCard field. Used for Groupwise contacts.</dd>
          <dt><code>x-gadugadu</code></dt>
          <dd>The X-GADUGADU vCard field. Used for Gadu-Gadu contacts.</dd>
          <dt><code>x-jabber</code></dt>
          <dd>The X-JABBER vCard field. Used for XMPP JIDs.</dd>
          <dt><code>x-msn</code></dt>
          <dd>The X-MSN vCard field. Used for MSN contacts.</dd>
          <dt><code>x-yahoo</code></dt>
          <dd>The X-YAHOO vCard field. Used for Yahoo! IDs.</dd>
          <dt><code>x-facebook-id</code></dt>
          <dd>Used for Facebook IDs in XMPP. If the user JID is
          "-12345@chat.facebook.com" then the x-facebook-id is "12345"</dd>
        </dl>

      </tp:docstring>
    </property>

    <property name="AddressableURISchemes"
              tp:name-for-bindings="Addressable_URI_Schemes"
              access="read" type="as">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>The URI schemes that are supported by this protocol.</p>

        <p>For example: <code>["tel", "sip"]</code>.</p>

        <p>This property should only be used when the connection is
          offline. When it is connected the addressable URI schemes should be
          retrieved from the
          <tp:dbus-ref
             namespace="org.freedesktop.Telepathy.Connection.Interface">Requests.RequestableChannelClasses</tp:dbus-ref>'s
             TargetURIScheme fixed-property instead.</p>

        <p>Connection managers with a <code>.manager</code> file
          MUST cache this property in the protocol's section of the
          <code>.manager</code> file if it is non-empty, using the key
          <code>AddressableURISchemes</code>. The corresponding value
          is a list of strings, each followed with a semicolon and in the
          syntax of the "localestring" type from the Desktop Entry
          Specification.</p>

        <p>Well-known URI schemes:</p>

        <dl>
          <dt><code>sip</code></dt>
          <dd>SIP protocol.
            For example: <code>sip:julien@example.com</code>.</dd>
          <dt><code>sips</code></dt>
          <dd>Secure (encrypted) SIP protocol.
            For example: <code>sips:julien@example.com</code>.</dd>
          <dt><code>tel</code></dt>
          <dd>Used for telephone numbers.
            For example: <code>tel:+12065551234</code>.</dd>
          <dt><code>xmpp</code></dt>
          <dd>XMPP protocol.
            For example: <code>xmpp:julien@example.com</code>.</dd>
          <dt><code>msnim</code></dt>
          <dd>For the purposes of
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Protocol.Interface.Addressing</tp:dbus-ref>,
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Addressing1</tp:dbus-ref>,
            and
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interface.Addressing1</tp:dbus-ref>,
            the verb part is ignored, and SHOULD be <code>add</code>; the
            <code>contact</code> field in the query string is used to
            identify the contact.
            For example: <code>msnim:add?contact=julien</code>.</dd>
          <dt><code>aim</code></dt>
          <dd>For the purposes of
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Protocol.Interface.Addressing</tp:dbus-ref>,
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Addressing1</tp:dbus-ref>,
            and
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interface.Addressing1</tp:dbus-ref>,
            the verb part is ignored, and SHOULD be <code>addbuddy</code>; the
            <code>screenname</code> field in the query string is used to
            identify the contact.
            For example: <code>aim:addbuddy?screenname=julien</code>.</dd>
          <dt><code>skype</code></dt>
          <dd>Skype protocol.
            For example: <code>skype:julien</code>.</dd>
          <dt><code>ymsgr</code></dt>
          <dd>For the purposes of
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Protocol.Interface.Addressing</tp:dbus-ref>,
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Addressing1</tp:dbus-ref>,
            and
            <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interface.Addressing1</tp:dbus-ref>,
            the verb part is ignored, and SHOULD be <code>addfriend</code>; the
            query string is used to identify the contact.
            For example: <code>ymsgr:addfriend?julien</code>.</dd>
          <dt><code>gg</code></dt>
          <dd>Gadu-Gadu protocol.
            For example: <code>gg:julien</code>.</dd>
        </dl>
      </tp:docstring>
    </property>

    <method name="NormalizeVCardAddress"
      tp:name-for-bindings="Normalize_VCard_Address">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Attempt to normalize the given vCard address. Where possible, this
          SHOULD return an address that would appear in the
          <code>org.freedesktop.Telepathy.Connection.Interface.Addressing1/addresses</code>
          attribute for a contact on a connected
          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>.
        </p>

        <p>If full normalization requires network activity or is otherwise
          impossible to do without a <tp:dbus-ref
            namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>,
          this method SHOULD perform a best-effort normalization.</p>

        <p>An example would be a vCard TEL field with a formatted
          number in the form of <code>+1 (206) 555 1234</code>, this would be
          normalized to <code>+12065551234</code>.</p>

        <p>This method MAY simply raise NotImplemented on some
        protocols, if it has no use.</p>
      </tp:docstring>

      <arg direction="in" name="VCard_Field" type="s">
        <tp:docstring>
          The vCard field of the address we are normalizing. The
          field name SHOULD be in lower case, and MUST appear in
          <tp:member-ref>AddressableVCardFields</tp:member-ref>.
        </tp:docstring>
      </arg>

      <arg direction="in" name="VCard_Address" type="s">
        <tp:docstring>
          The address to normalize, which is assumed to belong to a
          contact (and not, for instance, a chatroom or server).
        </tp:docstring>
      </arg>

      <arg direction="out" name="Normalized_VCard_Address" type="s">
        <tp:docstring>
          The vCard address, normalized as much as possible.
        </tp:docstring>
      </arg>

      <tp:possible-errors>
        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
          <tp:docstring>
            The vCard field is not supported (it is not in
            <tp:member-ref>AddressableVCardFields</tp:member-ref>).
          </tp:docstring>
        </tp:error>

        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
          <tp:docstring>
            The address is syntactically incorrect.
          </tp:docstring>
        </tp:error>
      </tp:possible-errors>
    </method>

    <method name="NormalizeContactURI"
      tp:name-for-bindings="Normalize_Contact_URI">
      <tp:added version="0.25.1">(renamed from NormalizeURI)</tp:added>
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Attempt to normalize the given contact URI. Where possible, this
          SHOULD return an address that would appear in the
          <code>org.freedesktop.Telepathy.Connection.Interface.Addressing1/uris</code>
          attribute for a contact on a connected
          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>.
        </p>

        <p>If full normalization requires network activity or is otherwise
          impossible to do without a <tp:dbus-ref
            namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>,
          this method SHOULD perform a best-effort normalization.</p>

        <p>If the URI has extra information beyond what's necessary to
          identify a particular contact, such as an XMPP resource or an
          action to carry out, this extra information SHOULD be removed.
          If all URIs in a scheme contain a verb or action
          (like <code>aim</code>, <code>ymsgr</code> and
          <code>msnim</code> URIs), then the verb SHOULD be replaced
          with the one specified in
          <tp:member-ref>AddressableURISchemes</tp:member-ref>.</p>

        <tp:rationale>
          <p>This method is intended to normalize URIs stored in address
            books, for instance. In protocols like XMPP, if you
            vary the resource or action (query string), the URI still
            refers to the same high-level contact.</p>
        </tp:rationale>

        <p>For instance,
          <code>xmpp:romeo@Example.Com/Empathy?message;body=Hello</code>
          would be normalized to <code>xmpp:romeo@example.com</code>,
          and <code>aim:goim?screenname=Romeo%20M&amp;message=Hello</code>
          would be normalized to
          <code>aim:addbuddy?screenname=romeom</code>.</p>

        <p>This method MAY simply raise NotImplemented on some
        protocols, if it has no use.</p>
      </tp:docstring>

      <arg direction="in" name="URI" type="s">
        <tp:docstring>
          <p>The URI to normalize, which is assumed to refer to a contact
            (as opposed to, for instance, a chatroom or a server).</p>

        <tp:rationale>
          <p>In some protocols, like XMPP, there is no way to tell whether
            a given URI refers to a contact or a chatroom by looking at
            its syntax.</p>
        </tp:rationale>

          <p>The URI's scheme (i.e. the part before
            the first colon) MUST appear in
            <tp:member-ref>AddressableURISchemes</tp:member-ref>.</p>
        </tp:docstring>
      </arg>

      <arg direction="out" name="Normalized_URI" type="s">
        <tp:docstring>
          A URI, normalized as much as possible.
        </tp:docstring>
      </arg>

      <tp:possible-errors>
        <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
          <tp:docstring>
            The URI scheme is not supported (it is not in
            <tp:member-ref>AddressableURISchemes</tp:member-ref>).
          </tp:docstring>
        </tp:error>

        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
          <tp:docstring>
            <p>The URI is syntactically incorrect or cannot be interpreted
              as a reference to a contact.</p>

            <tp:rationale>
              <p>For instance, <code>aim:!?</code> is not a valid AIM URI,
                while <code>aim:goaway?message=Absent</code> is a
                valid AIM URI, but not a contact.</p>
            </tp:rationale>
          </tp:docstring>
        </tp:error>
      </tp:possible-errors>
    </method>

 </interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->