@@ -4,6 +4,7 @@ import com.ably.Subscription
44import io.ably.lib.realtime.ChannelState
55import io.ably.lib.realtime.CompletionListener
66import io.ably.lib.realtime.Presence.PresenceListener
7+ import io.ably.lib.types.MessageExtras
78import io.ably.lib.types.PresenceMessage
89import java.util.*
910
@@ -71,59 +72,63 @@ public interface RealtimePresence : Presence {
7172 public fun subscribe (actions : EnumSet <PresenceMessage .Action >, listener : PresenceListener ): Subscription
7273
7374 /* *
74- * Enters the presence set for the channel, optionally passing a data payload.
75+ * Enters the presence set for the channel, optionally passing a data payload and extras .
7576 * A clientId is required to be present on a channel.
7677 * An optional callback may be provided to notify of the success or failure of the operation.
7778 *
7879 * Spec: RTP8
7980 *
8081 * @param data The payload associated with the presence member.
82+ * @param extras The extras associated with the presence member.
8183 * @param listener A callback to notify of the success or failure of the operation.
8284 * This listener is invoked on a background thread.
8385 */
84- public fun enter (data : Any? = null, listener : CompletionListener ? = null)
86+ public fun enter (data : Any? = null, extras : MessageExtras ? = null, listener : CompletionListener ? = null)
8587
8688 /* *
87- * Updates the data payload for a presence member.
89+ * Updates the data payload for a presence member, optionally passing extras .
8890 * If called before entering the presence set, this is treated as an [PresenceMessage.Action.enter] event.
8991 * An optional callback may be provided to notify of the success or failure of the operation.
9092 *
9193 * Spec: RTP9
9294 *
9395 * @param data The payload associated with the presence member.
96+ * @param extras The extras associated with the presence member.
9497 * @param listener A callback to notify of the success or failure of the operation.
9598 * This listener is invoked on a background thread.
9699 */
97- public fun update (data : Any? = null, listener : CompletionListener ? = null)
100+ public fun update (data : Any? = null, extras : MessageExtras ? = null, listener : CompletionListener ? = null)
98101
99102 /* *
100- * Leaves the presence set for the channel.
103+ * Leaves the presence set for the channel, optionally passing extras .
101104 * A client must have previously entered the presence set before they can leave it.
102105 *
103106 * Spec: RTP10
104107 *
105108 * @param data The payload associated with the presence member.
109+ * @param extras The extras associated with the presence member.
106110 * @param listener a listener to notify of the success or failure of the operation.
107111 * This listener is invoked on a background thread.
108112 */
109- public fun leave (data : Any? = null, listener : CompletionListener ? = null)
113+ public fun leave (data : Any? = null, extras : MessageExtras ? = null, listener : CompletionListener ? = null)
110114
111115 /* *
112- * Enters the presence set of the channel for a given clientId.
116+ * Enters the presence set of the channel for a given clientId, optionally passing extras .
113117 * Enables a single client to update presence on behalf of any number of clients using a single connection.
114118 * The library must have been instantiated with an API key or a token bound to a wildcard clientId.
115119 *
116120 * Spec: RTP4, RTP14, RTP15
117121 *
118122 * @param clientId The ID of the client to enter into the presence set.
119123 * @param data The payload associated with the presence member.
124+ * @param extras The extras associated with the presence member.
120125 * @param listener A callback to notify of the success or failure of the operation.
121126 * This listener is invoked on a background thread.
122127 */
123- public fun enterClient (clientId : String , data : Any? = null, listener : CompletionListener ? = null)
128+ public fun enterClient (clientId : String , data : Any? = null, extras : MessageExtras ? = null, listener : CompletionListener ? = null)
124129
125130 /* *
126- * Updates the data payload for a presence member using a given clientId.
131+ * Updates the data payload for a presence member using a given clientId, optionally passing extras .
127132 * Enables a single client to update presence on behalf of any number of clients using a single connection.
128133 * The library must have been instantiated with an API key or a token bound to a wildcard clientId.
129134 * An optional callback may be provided to notify of the success or failure of the operation.
@@ -132,22 +137,24 @@ public interface RealtimePresence : Presence {
132137 *
133138 * @param clientId The ID of the client to update in the presence set.
134139 * @param data The payload to update for the presence member.
140+ * @param extras The extras associated with the presence member.
135141 * @param listener A callback to notify of the success or failure of the operation.
136142 * This listener is invoked on a background thread.
137143 */
138- public fun updateClient (clientId : String , data : Any? = null, listener : CompletionListener ? = null)
144+ public fun updateClient (clientId : String , data : Any? = null, extras : MessageExtras ? = null, listener : CompletionListener ? = null)
139145
140146 /* *
141- * Leaves the presence set of the channel for a given clientId.
147+ * Leaves the presence set of the channel for a given clientId, optionally passing extras .
142148 * Enables a single client to update presence on behalf of any number of clients using a single connection.
143149 * The library must have been instantiated with an API key or a token bound to a wildcard clientId.
144150 *
145151 * Spec: RTP15
146152 *
147153 * @param clientId The ID of the client to leave the presence set for.
148154 * @param data The payload associated with the presence member.
155+ * @param extras The extras associated with the presence member.
149156 * @param listener A callback to notify of the success or failure of the operation.
150157 * This listener is invoked on a background thread.
151158 */
152- public fun leaveClient (clientId : String? , data : Any? = null, listener : CompletionListener ? = null)
159+ public fun leaveClient (clientId : String? , data : Any? = null, extras : MessageExtras ? = null, listener : CompletionListener ? = null)
153160}
0 commit comments