when setting moderated also set non standard field to not make users participants by default
This commit is contained in:
parent
08bc3ca0d5
commit
7b5d0e034e
|
@ -3172,16 +3172,20 @@ public class XmppConnectionService extends Service {
|
||||||
conversation.setAttribute("accept_non_anonymous", true);
|
conversation.setAttribute("accept_non_anonymous", true);
|
||||||
updateConversation(conversation);
|
updateConversation(conversation);
|
||||||
}
|
}
|
||||||
IqPacket request = new IqPacket(IqPacket.TYPE.GET);
|
if (options.containsKey("muc#roomconfig_moderatedroom")) {
|
||||||
|
final boolean moderated = "1".equals(options.getString("muc#roomconfig_moderatedroom"));
|
||||||
|
options.putString("members_by_default", moderated ? "0" : "1");
|
||||||
|
}
|
||||||
|
final IqPacket request = new IqPacket(IqPacket.TYPE.GET);
|
||||||
request.setTo(conversation.getJid().asBareJid());
|
request.setTo(conversation.getJid().asBareJid());
|
||||||
request.query("http://jabber.org/protocol/muc#owner");
|
request.query("http://jabber.org/protocol/muc#owner");
|
||||||
sendIqPacket(conversation.getAccount(), request, new OnIqPacketReceived() {
|
sendIqPacket(conversation.getAccount(), request, new OnIqPacketReceived() {
|
||||||
@Override
|
@Override
|
||||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||||
if (packet.getType() == IqPacket.TYPE.RESULT) {
|
if (packet.getType() == IqPacket.TYPE.RESULT) {
|
||||||
Data data = Data.parse(packet.query().findChild("x", Namespace.DATA));
|
final Data data = Data.parse(packet.query().findChild("x", Namespace.DATA));
|
||||||
data.submit(options);
|
data.submit(options);
|
||||||
IqPacket set = new IqPacket(IqPacket.TYPE.SET);
|
final IqPacket set = new IqPacket(IqPacket.TYPE.SET);
|
||||||
set.setTo(conversation.getJid().asBareJid());
|
set.setTo(conversation.getJid().asBareJid());
|
||||||
set.query("http://jabber.org/protocol/muc#owner").addChild(data);
|
set.query("http://jabber.org/protocol/muc#owner").addChild(data);
|
||||||
sendIqPacket(account, set, new OnIqPacketReceived() {
|
sendIqPacket(account, set, new OnIqPacketReceived() {
|
||||||
|
|
Loading…
Reference in a new issue