summaryrefslogtreecommitdiff
path: root/spec/Channel_Interface_Chat_State1.xml
blob: 5984558fc365af3add819c99c5453f8d0b3f747b (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
<?xml version="1.0" ?>
<node name="/Channel_Interface_Chat_State1" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
  <tp:copyright> Copyright (C) 2007 Collabora Limited </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.telepathy.v1.Channel.Interface.ChatState1">
    <tp:requires interface="im.telepathy.v1.Channel.Type.Text"/>

    <tp:mapping name="Chat_State_Map">
      <tp:added version="0.19.7"/>
      <tp:docstring>A map from contacts to their chat states.</tp:docstring>
      <tp:member name="Contact" type="u" tp:type="Contact_Handle">
        <tp:docstring>A contact</tp:docstring>
      </tp:member>
      <tp:member name="State" type="u" tp:type="Channel_Chat_State">
        <tp:docstring>The contact's chat state</tp:docstring>
      </tp:member>
    </tp:mapping>

    <property name="ChatStates" tp:name-for-bindings="Chat_States"
      access="read" type="a{uu}" tp:type="Chat_State_Map">
      <tp:added version="0.19.7"/>
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>A map containing the chat states of all contacts in this
          channel whose chat state is not Inactive.</p>

        <p>Contacts in this channel, but who are not listed in this map,
          may be assumed to be in the Inactive state.</p>
      </tp:docstring>
    </property>

    <method name="SetChatState" tp:name-for-bindings="Set_Chat_State">
      <arg direction="in" name="State" type="u" tp:type="Channel_Chat_State">
        <tp:docstring>
          The new state.
        </tp:docstring>
      </arg>
      <tp:docstring>
        Set the local state and notify other members of the channel that it
        has changed.
      </tp:docstring>
      <tp:possible-errors>
        <tp:error name="im.telepathy.v1.Error.NetworkError"/>
        <tp:error name="im.telepathy.v1.Error.NotAvailable"/>
        <tp:error name="im.telepathy.v1.Error.InvalidArgument"/>
      </tp:possible-errors>
    </method>
    <signal name="ChatStateChanged" tp:name-for-bindings="Chat_State_Changed">
      <arg name="Contact" type="u" tp:type="Contact_Handle">
        <tp:docstring>
          An integer handle for the contact.
        </tp:docstring>
      </arg>
      <arg name="State" type="u" tp:type="Channel_Chat_State">
        <tp:docstring>
          The new state of this contact.
        </tp:docstring>
      </arg>
      <tp:docstring>
        Emitted when the state of a member of the channel has changed.
        This includes local state.
      </tp:docstring>
    </signal>
    <tp:enum name="Channel_Chat_State" type="u">
      <tp:enumvalue suffix="Gone" value="0">
        <tp:docstring>
        The contact has effectively ceased participating in the chat.
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Inactive" value="1">
        <tp:docstring>
        The contact has not been active for some time.
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Active" value="2">
        <tp:docstring>
        The contact is actively participating in the chat.
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Paused" value="3">
        <tp:docstring>
        The contact has paused composing a message.
        </tp:docstring>
      </tp:enumvalue>
      <tp:enumvalue suffix="Composing" value="4">
        <tp:docstring>
        The contact is composing a message to be sent to the chat.
        </tp:docstring>
      </tp:enumvalue>
    </tp:enum>
    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>An interface for channels for receiving notifications of remote contacts'
      state, and for notifying remote contacts of the local state.</p>

      <p>Clients should assume that a contact's state is Channel_Chat_State_Inactive
      unless they receive a notification otherwise.</p>

      <p>The Channel_Chat_State_Gone state is treated differently to other states:</p>
      <ul>
        <li>It may not be used for multi-user chats</li>
        <li>It may not be explicitly sent</li>
        <li>It should be automatically sent when the channel is closed</li>
        <li>It must not be sent to the peer if a channel is closed without being used</li>
        <li>Receiving it must not cause a new channel to be opened</li>
      </ul>

      <p>The different states are defined by XEP-0085, but may be applied to any suitable protocol.</p>
    </tp:docstring>
  </interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->