|
@@ -1130,6 +1130,30 @@ export default class ChatRoom extends Listenable {
|
1130
|
1130
|
}
|
1131
|
1131
|
}
|
1132
|
1132
|
|
|
1133
|
+ /**
|
|
1134
|
+ *
|
|
1135
|
+ * @param jid
|
|
1136
|
+ * @param affiliation
|
|
1137
|
+ */
|
|
1138
|
+ setAffiliation(jid, affiliation) {
|
|
1139
|
+ const grantIQ = $iq({
|
|
1140
|
+ to: this.roomjid,
|
|
1141
|
+ type: 'set'
|
|
1142
|
+ })
|
|
1143
|
+ .c('query', { xmlns: 'http://jabber.org/protocol/muc#admin' })
|
|
1144
|
+ .c('item', {
|
|
1145
|
+ affiliation,
|
|
1146
|
+ nick: Strophe.getResourceFromJid(jid)
|
|
1147
|
+ })
|
|
1148
|
+ .c('reason').t(`Your affiliation has been changed to '${affiliation}'.`)
|
|
1149
|
+ .up().up().up();
|
|
1150
|
+
|
|
1151
|
+ this.connection.sendIQ(
|
|
1152
|
+ grantIQ,
|
|
1153
|
+ result => logger.log('Set affiliation of participant with jid: ', jid, 'to', affiliation, result),
|
|
1154
|
+ error => logger.log('Set affiliation of participant error: ', error));
|
|
1155
|
+ }
|
|
1156
|
+
|
1133
|
1157
|
/**
|
1134
|
1158
|
*
|
1135
|
1159
|
* @param jid
|