From 18eb18794988ab94979020060e9bee9fe7fd9b67 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 10 Jan 2015 23:10:32 +0100 Subject: make room persistant when changing subject or other muc options --- .../siacs/conversations/services/XmppConnectionService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/eu/siacs/conversations/services') diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 28a353b6..521991ba 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1544,6 +1544,18 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa }); } + public void pushSubjectToConference(final Conversation conference, final String subject) { + MessagePacket packet = this.getMessageGenerator().conferenceSubject(conference, subject); + this.sendMessagePacket(conference.getAccount(), packet); + final MucOptions mucOptions = conference.getMucOptions(); + final MucOptions.User self = mucOptions.getSelf(); + if (!mucOptions.persistent() && self.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) { + Bundle options = new Bundle(); + options.putString("muc#roomconfig_persistentroom", "1"); + this.pushConferenceConfiguration(conference,options,null); + } + } + public void changeAffiliationInConference(final Conversation conference, Jid user, MucOptions.Affiliation affiliation, final OnAffiliationChanged callback) { final Jid jid = user.toBareJid(); IqPacket request = this.mIqGenerator.changeAffiliation(conference, jid, affiliation.toString()); -- cgit v1.2.3