aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <inputmice@siacs.eu>2015-01-08 01:23:53 +0100
committerDaniel Gultsch <inputmice@siacs.eu>2015-01-08 01:23:53 +0100
commitf8aa1bfec4df8cc7e34eae537f68ab45ed62756c (patch)
tree87ee7ef850a182c966e10f5b2a7734d09f21642e /src/main/java/eu/siacs/conversations/services
parentf8dc59be818b3a16e975bda189ad3af2f52311e6 (diff)
kick after ban
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 5c16ef3f7..495b9c261 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1562,6 +1562,27 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
public void onAffiliationChangeFailed(Jid jid, int resId);
}
+ public void changeRoleInConference(final Conversation conference, final String nick, MucOptions.Role role, final OnRoleChanged callback) {
+ IqPacket request = this.mIqGenerator.changeRole(conference, nick, role.toString());
+ Log.d(Config.LOGTAG,request.toString());
+ sendIqPacket(conference.getAccount(), request, new OnIqPacketReceived() {
+ @Override
+ public void onIqPacketReceived(Account account, IqPacket packet) {
+ Log.d(Config.LOGTAG, packet.toString());
+ if (packet.getType() == IqPacket.TYPE.RESULT) {
+ callback.onRoleChangedSuccessful(nick);
+ } else {
+ callback.onRoleChangeFailed(nick, R.string.could_not_change_role);
+ }
+ }
+ });
+ }
+
+ public interface OnRoleChanged{
+ public void onRoleChangedSuccessful(String nick);
+ public void onRoleChangeFailed(String nick, int resid);
+ }
+
public void disconnect(Account account, boolean force) {
if ((account.getStatus() == Account.State.ONLINE)
|| (account.getStatus() == Account.State.DISABLED)) {