Private Events¶
Event creation¶
user0 request the creation of an event, the buddy has to send this iq in order to create the event.
Tag |
Required |
Value |
Description |
|---|---|---|---|
x:type |
true |
event_creation |
Fixed value for the message |
x:payload |
true |
json object |
Represents message content |
payload:event |
true |
Event object |
Client request example:
<message to="test@domain" id="1486028547270039399072925" type="chat">
<body />
<x xmlns="jabber:x:oob">
<type>event_creation</type>
<payload>
{
"event":
{
"jid": "event-jid",
"occupants": [
{
"jabberId":"user0",
"isAdmin": true,
"isOwner": true
},
{
"jabberId":"user1",
"isAdmin": true
},
{
"jabberId":"user2"
},
{
"jabberId":"user3"
}
],
"start_date": "datetime",
"end_date": "datetime",
"roomname": "event_name",
"subject": "description",
"event_type": "closed",
"label": "label",
"location": {
"lat": 42,
"lng": 12,
"location_name": "locale",
"street_address": "via"
},
"members_can_invite": true,
"members_can_chat": true
}
}
</payload>
</x>
</message>
Buddy action:
<iq from="buddy" id="conf2" to="MUC_Light generated jid" type="set">
<query xmlns="urn:xmpp:muclight:0#create">
<configuration>
<users>[
{jabberId: "user0", "state": "maybe", isAdmin:true, isOwner = true},
{jabberId: "user1", "state": "maybe", isAdmin:true, isOwner = false},
{jabberId: "user2", "state": "maybe", isAdmin:false, isOwner = false},
{jabberId: "user3", "state": "maybe", isAdmin:false, isOwner = false}
]</users>
<start_date>datetime</start_date>
<end_date>datetime</end_date>
<roomname>event_name</roomname>
<subject>description</subject>
<type>event</type>
<label>label</label>
<event_type>closed</event_type>
<location>{"lat":42, "lng":12, "location_name":"locale", "street_address":"via"}</location>
<members_can_invite>true</members_can_invite>
<members_can_chat>true</members_can_chat>
</configuration>
<occupants>
<user affiliation='member'>user0</user>
<user affiliation='member'>user1</user>
<user affiliation='member'>user2</user>
<user affiliation='member'>user3</user>
</occupants>
</query>
</iq>
Configuration change¶
Only admin can require changes Someone send the new configuration to the buddy, the the buddy has to send this message to change the configuration.
Tag |
Required |
Value |
Description |
|---|---|---|---|
x:type |
true |
event_creation |
Fixed value for the message |
x:payload |
true |
json object |
Represents message content |
payload:event |
true |
Event object |
Client request example:
<message to="test@domain" id="1486028547270039399072925" type="chat">
<body />
<x xmlns="jabber:x:oob">
<type>event_change_configuration</type>
<payload>
{
"event": {
"jid": "event-jid",
"occupants":
[{
"*jabberId":"user4",
"state": "maybe",
"action": "add",
"isAdmin": true
},{
"jabberId":"user2",
"state": "maybe",
"action": "remove"
}],
"start_date": "datetime",
"end_date": "datetime",
"roomname": "event_name",
"subject": "description",
"event_type": "closed",
"label": "label",
"location": {
"lat": 42,
"lng": 12,
"location_name": "locale",
"street_address": "via"
},
"members_can_invite": true,
"members_can_chat": true
}
}
</payload>
</x>
</message>
Buddy action:
Occupants changes¶
All members can require this changes. Someone send the new configuration to the buddy, the the buddy has to send this message to change the occupants list configuration.
Tag |
Required |
Value |
Description |
|---|---|---|---|
x:type |
true |
event_creation |
Fixed value for the message |
x:payload |
true |
json object |
Represents message content |
payload:event |
true |
Event object |
Client request example:
<message to="test@domain" id="1486028547270039399072925" type="chat">
<body />
<x xmlns="jabber:x:oob">
<type>event_change_occupants</type>
<payload>
{
"event":
{
"jid": "event-jid",
"occupants":
[{
"*jabberId":"user3",
"action": "add"
}]
}
}
</payload>
</x>
</message>
Buddy action:
The buddy must only send changed tags¶
<iq from="buddy" id="conf2" to="MUC_Light generated jid" type="set">
<query
xmlns="urn:xmpp:muclight:0#configuration">
<configuration>
<users>[
{jabberId: "user0", "state": "maybe", isAdmin:true},
{jabberId: "user1", "state": "maybe", isAdmin:false},
{jabberId: "user3", "state": "maybe", isAdmin:false},
{jabberId: "user4", "state": "maybe", isAdmin:true}
]</users>
</configuration>
<occupants>
<user affiliation='member'>user0</user>
<user affiliation='member'>user1</user>
<user affiliation='member'>user3</user>
<user affiliation='member'>user4</user>
</occupants>
</query>
</iq>