summaryrefslogtreecommitdiff
path: root/spec/Connection.xml
blob: fde7da3275012964d51ade6e3b962836c94fed60 (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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
<?xml version="1.0" ?>
<node name="/Connection"
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
  >
  <tp:copyright>Copyright (C) 2005-2009 Collabora Limited</tp:copyright>
  <tp:copyright>Copyright (C) 2005-2009 Nokia Corporation</tp:copyright>
  <tp:copyright>Copyright (C) 2006 INdT</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="im.telepathy1.Connection">
    <tp:requires interface="im.telepathy1.Connection.Interface.Requests"/>
    <tp:requires interface="im.telepathy1.Connection.Interface.Contacts"/>

    <method name="Connect" tp:name-for-bindings="Connect">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Request that the connection be established. This will be done
          asynchronously and errors will be returned by emitting
          <tp:member-ref>StatusChanged</tp:member-ref> signals.</p>

        <p>Calling this method on a Connection that is already connecting
          or connected is allowed, and has no effect.</p>
      </tp:docstring>
    </method>

    <method name="Disconnect" tp:name-for-bindings="Disconnect">
      <tp:docstring>
        Request that the connection be closed. This closes the connection if
        it's not already in DISCONNECTED state, and destroys the connection
        object.
      </tp:docstring>
    </method>

    <property name="Interfaces" tp:name-for-bindings="Interfaces"
      access="read" type="as" tp:type="DBus_Interface[]">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>The set of optional interfaces supported by this connection.
          Before the connection status changes to CONNECTED,
          this property may change at any time, but it is guaranteed that
          interfaces will only be added, not removed. After the connection
          status changes to CONNECTED, this property cannot
          change further.</p>

        <p>There is no explicit change notification; reasonable behaviour
          for a client would be to retrieve the interfaces list once
          initially, and once more when it becomes CONNECTED.</p>

        <tp:rationale>
          <p>In some connection managers, certain capabilities of a connection
            are known to be implemented for all connections (e.g. support
            for Presence), and some interfaces (like Presence) can
            even be used before connecting. Other capabilities may
            or may not exist, depending on server functionality; by the time
            the connection goes CONNECTED, the connection manager is expected
            to have evaluated the server's functionality and enabled any extra
            interfaces for the remainder of the Connection's lifetime.</p>
        </tp:rationale>
      </tp:docstring>
      <tp:added version="0.19.2"/>
    </property>

    <signal name="SelfContactChanged"
        tp:name-for-bindings="Self_Contact_Changed">
      <tp:docstring>
        Emitted whenever the <tp:member-ref>SelfHandle</tp:member-ref> and
        <tp:member-ref>SelfID</tp:member-ref> property
        changes. If the connection
        is not yet in the CONNECTED state, this signal is not guaranteed
        to be emitted.
      </tp:docstring>
      <tp:added version="0.27.2">Clients MAY assume that if the
        SelfHandle and SelfID property exists, this signal will be emitted when
        necessary.</tp:added>

      <arg type="u" tp:type="Contact_Handle" name="Self_Handle">
        <tp:docstring>
          The new value of the SelfHandle property.
        </tp:docstring>
      </arg>
      <arg type="s" name="Self_ID">
        <tp:docstring>
          The new value of the SelfID property.
        </tp:docstring>
      </arg>
    </signal>

    <property name="SelfHandle" tp:name-for-bindings="Self_Handle"
      type="u" tp:type="Contact_Handle" access="read">
      <tp:docstring>
        The handle which represents the user on this connection, which will
        remain valid for the lifetime of this connection, or until a change
        in the user's identifier is signalled by the
        <tp:member-ref>SelfContactChanged</tp:member-ref> signal.
        If the connection is not yet in the CONNECTED state, the value of
        this property MAY be zero.
      </tp:docstring>
      <tp:added version="0.17.10"/>
    </property>

    <property name="SelfID" tp:name-for-bindings="Self_ID"
      type="s" access="read">
      <tp:docstring>
        The identifier which represents the user on this connection, which will
        remain valid for the lifetime of this connection, or until a change
        in the user's identifier is signalled by the
        <tp:member-ref>SelfContactChanged</tp:member-ref> signal.
        If the connection is not yet in the CONNECTED state, the value of
        this property MAY be empty string.
      </tp:docstring>
      <tp:added version="0.27.2"/>
    </property>

    <property name="Status" tp:name-for-bindings="Status"
      access="read" type="u" tp:type="Connection_Status">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>The current status of the connection. Change notification is via
          the <tp:member-ref>StatusChanged</tp:member-ref> signal.</p>

        <p>If retrieval of property succeeds and yields the value Disconnected,
          this indicates that the connection has not yet been established.
          If connection has been attempted and failed, the Connection object
          SHOULD be removed from the bus entirely, meaning that retrieval of
          this property SHOULD fail.</p>
      </tp:docstring>
      <tp:added version="0.19.2"/>
    </property>

    <tp:enum name="Handle_Type" type="u">
      <tp:enumvalue suffix="None" value="0">
        <tp:docstring>
          A "null" handle type used to indicate the absence of a handle.
          When a handle type and a handle appear as a pair, if the handle
          type is zero, the handle must also be zero.
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Contact" value="1">
        <tp:docstring>
          A contact
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Room" value="2">
        <tp:docstring>
          A chat room
        </tp:docstring>
      </tp:enumvalue>
    </tp:enum>

    <tp:simple-type name="Handle" type="u" array-name="Handle_List">
      <tp:docstring>An unsigned 32-bit integer representing a
        handle</tp:docstring>
    </tp:simple-type>

    <tp:simple-type name="Contact_Handle" type="u"
      array-name="Contact_Handle_List">
      <tp:docstring>An unsigned 32-bit integer representing a handle of type
        Handle_Type_Contact</tp:docstring>
    </tp:simple-type>

    <tp:simple-type name="Room_Handle" type="u"
      array-name="Room_Handle_List">
      <tp:docstring>An unsigned 32-bit integer representing a handle of type
        Handle_Type_Room</tp:docstring>
    </tp:simple-type>

    <tp:enum name="Connection_Status" plural="Connection_Statuses" type="u">
      <tp:enumvalue suffix="Connected" value="0">
        <tp:docstring>
          The connection is fully connected and all methods are available.
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Connecting" value="1">
        <tp:docstring>
          <tp:member-ref>Connect</tp:member-ref> has been called but the
          connection has not yet been established. Some methods may fail
          until the connection has been established.
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Disconnected" value="2">
        <tp:docstring>
          If this is retrieved from
          <tp:member-ref>Status</tp:member-ref>, it indicates that
          connection has not yet been attempted. If seen in a
          <tp:member-ref>StatusChanged</tp:member-ref> signal, it
          indicates that the connection has failed; the Connection
          object SHOULD be removed from D-Bus immediately, and all
          subsequent method calls SHOULD fail.
        </tp:docstring>
      </tp:enumvalue>
    </tp:enum>

    <tp:enum name="Connection_Status_Reason" type="u">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>A reason why the status of the connection changed. Apart from
          Requested, the values of this enumeration only make sense as
          reasons why the status changed to Disconnected.</p>
      </tp:docstring>

      <tp:enumvalue suffix="None_Specified" value="0">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>There is no reason set for this state change. Unknown status
            reasons SHOULD be treated like this reason.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.<tp:error-ref>Disconnected</tp:error-ref></code>.</p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Requested" value="1">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The change is in response to a user request. Changes to the
            Connecting or Connected status SHOULD always indicate this reason;
            changes to the Disconnected status SHOULD indicate this reason
            if and only if the disconnection was requested by the user.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cancelled</code>.</p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Network_Error" value="2">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>There was an error sending or receiving on the network socket.</p>

          <p>When the status changes from Connecting to Disconnected for this
            reason, the equivalent D-Bus error is either
            <code>im.telepathy1.Error.NetworkError</code>,
            <code>im.telepathy1.Error.ConnectionRefused</code>,
            <code>im.telepathy1.Error.ConnectionFailed</code>
            or some more specific error.</p>

          <p>When the status changes from Connected to Disconnected for this
            reason, the equivalent D-Bus error is either
            <code>im.telepathy1.Error.NetworkError</code>,
            <code>im.telepathy1.Error.ConnectionLost</code>
            or some more specific error.</p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Authentication_Failed" value="3">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The username or password was invalid.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.AuthenticationFailed</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Encryption_Error" value="4">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>There was an error negotiating SSL on this connection, or
            encryption was unavailable and require-encryption was set when the
            connection was created.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.EncryptionNotAvailable</code>
            if encryption was not available at all, or
            <code>im.telepathy1.Error.EncryptionError</code>
            if encryption failed.</p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Name_In_Use" value="5">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>In general, this reason indicates that the requested account
            name or other identification could not be used due to conflict
            with another connection. It can be divided into three cases:</p>

          <ul>
            <li>If the status change is from Connecting to Disconnected
              and the 'register' parameter to RequestConnection was present
              and true, the requested account could not be created on the
              server because it already exists.
              The equivalent D-Bus error is
              <code>im.telepathy1.Error.RegistrationExists</code>.
            </li>

            <li>If the status change is from Connecting to Disconnected
              but the 'register' parameter is absent or false, the connection
              manager could not connect to the specified account because
              a connection to that account already exists.
              The equivalent D-Bus error is
              <code>im.telepathy1.Error.AlreadyConnected</code>.

              <tp:rationale>
                In some protocols, like XMPP (when connecting with the same
                JID and resource as an existing connection), the existing
                connection "wins" and the new one fails to connect.
              </tp:rationale>
            </li>

            <li>If the status change is from Connected to Disconnected,
              the existing connection was automatically disconnected because
              a new connection to the same account (perhaps from a different
              client or location) was established.
              The equivalent D-Bus error is
              <code>im.telepathy1.Error.ConnectionReplaced</code>.

              <tp:rationale>
                In some protocols, like MSNP (when connecting twice with the
                same Passport), the new connection "wins" and the
                existing one is automatically disconnected.
              </tp:rationale>
            </li>
          </ul>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Not_Provided" value="6">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server did not provide a SSL certificate.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.NotProvided</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Untrusted" value="7">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate is signed by an untrusted certifying
            authority. This error SHOULD NOT be used to represent a self-signed
            certificate: use the more specific Cert_Self_Signed reason for
            that.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.Untrusted</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Expired" value="8">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate has expired.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.Expired</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Not_Activated" value="9">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate is not yet valid.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.NotActivated</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Hostname_Mismatch" value="10">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate did not match its hostname.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.HostnameMismatch</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Fingerprint_Mismatch" value="11">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate does not have the expected
            fingerprint.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.FingerprintMismatch</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Self_Signed" value="12">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate is self-signed.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.SelfSigned</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Other_Error" value="13">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>There was some other error validating the server's SSL
            certificate.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.Invalid</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Revoked" value="14">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate has been revoked.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.Revoked</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Insecure" value="15">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>The server's SSL certificate uses an insecure algorithm,
	  or is cryptographically weak.</p>

          <p>When disconnected for this reason, the equivalent D-Bus error is
            <code>im.telepathy1.Error.Cert.Insecure</code>.
          </p>
        </tp:docstring>
      </tp:enumvalue>

      <tp:enumvalue suffix="Cert_Limit_Exceeded" value="16">
	<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
	  <p>The length in bytes of the server certificate, or the depth of the
	  sever certificate chain exceed the limits imposed by the crypto
	  library.</p>

	  <p>When disconnected for this reason, the equivalent D-Bus error is
	    <code>im.telepathy1.Error.Cert.LimitExceeded</code>
	  </p>
	</tp:docstring>
      </tp:enumvalue>
    </tp:enum>

    <signal name="ConnectionError" tp:name-for-bindings="Connection_Error">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Emitted when an error occurs that renders this connection unusable.
        </p>

        <p>Whenever this signal is emitted, it MUST immediately be followed by
          a <tp:member-ref>StatusChanged</tp:member-ref> signal with status
          Connection_Status_Disconnected and an appropriate reason
          code.</p>

        <p>Connection managers SHOULD emit this signal on disconnection, but
          need not do so. Clients MUST support connection managers that emit
          StatusChanged(Disconnected, ...) without first emitting
          ConnectionError.</p>

        <tp:rationale>
          <p>This signal provides additional information about the reason
            for disconnection. The reason for connection is always
            straightforward - it was requested - so it does not need further
            explanation. However, on errors, it can be useful to provide
            additional information.</p>

          <p>The <tp:type>Connection_Status_Reason</tp:type> is not given
            here, since it will be signalled in
            <tp:member-ref>StatusChanged</tp:member-ref>. A reasonable client
            implementation would be to store the information given by this
            signal until StatusChanged is received, at which point the
            information given by this signal can be used to supplement the
            StatusChanged signal.</p>
        </tp:rationale>
      </tp:docstring>

      <arg name="Error" type="s" tp:type="DBus_Error_Name">
        <tp:docstring>
          The name of a D-Bus error describing the error that occurred,
          which may correspond to a
          <tp:type>Connection_Status_Reason</tp:type>, or may be a more
          specific Telepathy error
          (such as
          <code>im.telepathy1.Error.ConnectionRefused</code>
          for Connection_Status_Reason_Network_Error)
          or a protocol-specific or connection-manager-specific error in a
          suitable namespace.

          <tp:rationale>
            For instance, a SIP connection manager could signal
            "402 Payment Required" as an error in a
            connection-manager-specific namespace, or a link-local
            XMPP implementation that used Avahi could provide the error
            given to it by the avahi-daemon.
          </tp:rationale>
        </tp:docstring>
      </arg>

      <arg name="Details" type="a{sv}" tp:type="String_Variant_Map">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>Additional information about the error, which may include
            the following well-known keys:</p>

          <dl>
            <dt>debug-message (s)</dt>
            <dd>Debugging information on the change, corresponding to the
              message part of a D-Bus error message, which SHOULD NOT be
              displayed to users under normal circumstances</dd>

            <dt>server-message (s)</dt>
            <dd>A human-readable message from the server explaining what
              happened. This may be in the user's native language, or in the
              server operator's native language, or even in Lojban.</dd>

	    <dt>user-requested (b), expected-hostname (s), certificate-hostname (s)</dt>
	    <dd>The same details defined in <tp:type>TLS_Certificate_Rejection</tp:type>.</dd>
          </dl>

        </tp:docstring>
      </arg>

    </signal>

    <signal name="StatusChanged" tp:name-for-bindings="Status_Changed">
      <arg name="Status" type="u" tp:type="Connection_Status">
        <tp:docstring>
          An integer indicating the new status, as defined by ConnectionStatus
        </tp:docstring>
      </arg>

      <arg name="Reason" type="u" tp:type="Connection_Status_Reason">
        <tp:docstring>
          An integer indicating the reason for the status change, as defined
          by ConnectionStatusReason
        </tp:docstring>
      </arg>

      <tp:docstring>
        Emitted when the status of the connection changes.  All states and
        reasons have numerical values, as defined in ConnectionStatus
        and ConnectionStatusReason.
      </tp:docstring>
    </signal>

    <tp:contact-attribute name="contact-id" type="s">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>The normalized contact's identifier. Not necessarily the same string
          as passed to <tp:dbus-ref
          namespace="imt1.Connection.Interface.Contacts">GetContactByID</tp:dbus-ref>.
          As a special case, this is always present in the result of <tp:dbus-ref
            namespace="im.telepathy1.Connection.Interface.Contacts">GetContactAttributes</tp:dbus-ref>,
          whether it was explicitly requested or not.</p>
      </tp:docstring>
    </tp:contact-attribute>

    <method name="AddClientInterest" tp:name-for-bindings="Add_Client_Interest">
      <tp:added version="0.21.3"/>
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Register a client's interest in notifications related to one or
          more interfaces.</p>

        <p>Groups of notifications are identified by a token which is either
          a D-Bus interface name, or a string that starts with a D-Bus
          interface name. The meaning of each token is given by that D-Bus
          interface, which MUST define it in its documentation.</p>

        <tp:rationale>
          <p>Initially, all interests are in entire interface, but allowing
            other strings allows subscription to part of an interface; for
            instance, an interest in ...MailNotification/count could track
            the number of messages without caring about their detailed
            content.</p>
        </tp:rationale>

        <p>For each token with which this method interacts, the
          Connection tracks an "interest count" (like a reference count) for
          each unique bus name that has called this method. When a client
          calls this method, for each token, the interest count for its
          unique bus name is incremented; when
          <tp:member-ref>RemoveClientInterest</tp:member-ref> is called,
          all interest counts for that unique bus name are decremented.
          If the unique bus name leaves the bus (for instance, if the
          client crashes or exits), all interest counts for that unique bus
          name are set to zero.</p>

        <p>The Connection can then use these reference counts to
          avoid subscribing to protocol-level notifications unless at least
          one client has a non-zero interest count for the relevant
          token.</p>

        <tp:rationale>
          <p>This method exists to reduce memory and network overhead when
            there is no active subscription.</p>

          <p>One situation where this is useful is <tp:dbus-ref
              namespace="im.telepathy1.Connection.Interface"
              >Location1</tp:dbus-ref>: on XMPP, location updates are received
            over PEP. If the Connection advertises the
            <code>geoloc+notify</code> capability, it will be sent location
            updates for all contacts. To avoid consuming resources for this,
            the connection should avoid advertising that capability until
            a client has expressed an interest in contacts' locations.</p>

          <p>Another example of a protocol that benefits from this method is
            the Google XMPP Mail Notification extension, which can be used
            to implement <tp:dbus-ref
              namespace="im.telepathy1.Connection.Interface"
              >MailNotification1</tp:dbus-ref>. In this protocol, the CM
            receives a notification that something has changed, but to get
            more information, the CM must request this information. Knowing
            that nobody is currently interested in this information, the CM
            can avoid generating useless network traffic. Similarly, the CM
            may free the list of unread messages to reduce memory overhead.</p>
        </tp:rationale>

        <p>If this method is called for an interface that might require
          protocol-level subscription, but the connection cannot set up
          that subscription yet (for instance because the
          <tp:member-ref>Status</tp:member-ref> is not Connected yet), the
          Connection MUST remember the client's interest, and attempt to
          subscribe to the appropriate protocol feature when this becomes
          possible.</p>

        <p>Clients MAY ignore any errors raised by this method; it is intended
          to be called with the reply ignored.</p>

        <tp:rationale>
          <p>The only reason it could fail is if it's unimplemented, in which
            case the only thing the client can usefully do is to proceed as if
            it had succeeded.</p>
        </tp:rationale>
      </tp:docstring>

      <arg name="Tokens" type="as" direction="in">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>Interfaces or parts of interfaces in which to register an
            interest, represented by either a
            <tp:type>DBus_Interface</tp:type>, or a string prefixed with a
            <tp:type>DBus_Interface</tp:type>.</p>

          <p>If the Connection does not support one of these tokens, this
            is not considered to be an error; the unsupported token is
            simply ignored.</p>
        </tp:docstring>
      </arg>
    </method>

    <method name="RemoveClientInterest"
      tp:name-for-bindings="Remove_Client_Interest">
      <tp:added version="0.21.3"/>
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>Release an interest registered using
          <tp:member-ref>AddClientInterest</tp:member-ref>. See that
          method's documentation for details.</p>

        <p>Clients MAY ignore any errors raised by this method; it is intended
          to be called with the reply ignored.</p>

        <tp:rationale>
          <p>The only reasons it could fail are if it's unimplemented, or if
            the client's reference-counting is wrong and it has tried to
            remove a client interest that it did not add. In both cases,
            there's nothing the client could do about it.</p>
        </tp:rationale>
      </tp:docstring>

      <arg name="Tokens" type="as" direction="in">
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          <p>Interfaces or parts of interfaces that were previously passed to
            <tp:member-ref>AddClientInterest</tp:member-ref>.</p>
        </tp:docstring>
      </arg>
    </method>

    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>This models a connection to a single user account on a communication
        service. Its basic capability is to provide the facility to request and
        receive channels of differing types (such as text channels or streaming
        media channels) which are used to carry out further communication.</p>

      <p>In order to allow Connection objects to be discovered by new clients,
        the object path and well-known bus name MUST be of the form
        <code>/im/telepathy1/Connection/cmname/proto/account</code>
        and
        <code>im.telepathy1.Connection.cmname.proto.account</code>
        where:</p>

      <ul>
        <li><em>cmname</em> is the same
          <tp:type>Connection_Manager_Name</tp:type> that appears
          in the connection manager's object path and well-known bus name</li>
        <li><em>proto</em> is the <tp:type>Protocol_Name</tp:type> as seen in
          <tp:dbus-ref namespace="imt1.ConnectionManager">Protocols</tp:dbus-ref>,
          but with "-" replaced with "_" to get a valid
          object path/bus name</li>
        <li><em>account</em> is some non-empty sequence of ASCII letters,
          digits and underscores not starting with a digit</li>
      </ul>

      <p><em>account</em> SHOULD be formed such that any valid distinct
        connection instance on this protocol has a distinct name. This
        might be formed by including the server name followed by the user
        name (escaped via some suitable mechanism like telepathy-glib's
        tp_escape_as_identifier() function to preserve uniqueness); on
        protocols where connecting multiple times is permissable, a
        per-connection identifier might be necessary to ensure
        uniqueness.</p>

      <p>Clients MAY parse the object path to determine the connection
        manager name and the protocol, but MUST NOT attempt to parse the
        <em>account</em> part. Connection managers MAY use any unique string
        for this part.</p>

    <p>As well as the methods and signatures below, arbitrary interfaces may be
    provided by the Connection object to represent extra connection-wide
    functionality, such as the Connection.Interface.Presence for
    receiving and
    reporting presence information, and Connection.Interface.Aliasing for
    connections where contacts may set and change an alias for themselves.
    These interfaces can be discovered using the
    <tp:member-ref>Interfaces</tp:member-ref> property.</p>

    <p>Contacts, rooms, and server-stored lists (such as subscribed contacts,
    block lists, or allow lists) on a service are all represented by
    immutable <em>handles</em>, which are unsigned non-zero integers which are
    valid only for the lifetime of the connection object, and are used
    throughout the protocol where these entities are represented, allowing
    simple testing of equality within clients.</p>

    <p>Zero as a handle value is sometimes used as a "null" value to mean
    the absence of a contact, room, etc.</p>

    <p>Handles have per-type uniqueness, meaning that every (handle
    type, handle number) tuple is guaranteed to be unique within a
    connection for the lifetime of the connection and that a handle
    alone (without its type) is meaningless or ambiguous.</p>
    </tp:docstring>

    <tp:changed version="0.17.10">Previously, the account part of
      Connection bus names/object paths was allowed to have more than one
      component (i.e. contain dots or slashes), resulting in Connection
      bus names and object paths with more than 7 components. We now restrict
      Connection bus names/object paths to have exactly 7
      components.</tp:changed>

    <tp:changed version="0.17.23">The Requests and Contacts interfaces
      are now mandatory. Their functionality will be merged into the main
      Connection interface at some point in future.</tp:changed>

    <tp:changed version="0.99.1">All deprecated types, methods,
      and signals have been removed from this interface including
      anything to do with handle reference counting.</tp:changed>

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