aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-02-09 15:22:29 +0100
committerChristian Schneppe <christian@pix-art.de>2019-02-09 15:22:29 +0100
commit163f5ae6229c99d72a73215ce1ba72827eefd93b (patch)
tree18004f07d09ab2e0af77dfdb4db7ca7f44b74006 /src/main/java/de/pixart/messenger/services
parent7aa49998425b768244715b19c9779202c0145230 (diff)
use the term channel in destroy dialog and some other strings
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 551ff7818..3f9ac5f99 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -3205,32 +3205,26 @@ public class XmppConnectionService extends Service {
});
}
- public void destroyRoom(final Conversation mSelectedConversation) {
- destroyRoom(mSelectedConversation, new OnRoomDestroy() {
- @Override
- public void onRoomDestroySucceeded(int resId) {
- Log.d(Config.LOGTAG, "Destroy succeed");
- showErrorToastInUi(resId);
- }
-
+ public void destroyRoom(final Conversation conversation, final OnRoomDestroy callback) {
+ IqPacket request = new IqPacket(IqPacket.TYPE.SET);
+ request.setTo(conversation.getJid().asBareJid());
+ request.query("http://jabber.org/protocol/muc#owner").addChild("destroy");
+ sendIqPacket(conversation.getAccount(), request, new OnIqPacketReceived() {
@Override
- public void onRoomDestroyFailed(int resId) {
- Log.d(Config.LOGTAG, "Destroy failed");
- showErrorToastInUi(resId);
+ public void onIqPacketReceived(Account account, IqPacket packet) {
+ if (packet.getType() == IqPacket.TYPE.RESULT) {
+ if (callback != null) {
+ callback.onRoomDestroySucceeded();
+ }
+ } else if (packet.getType() == IqPacket.TYPE.ERROR) {
+ if (callback != null) {
+ callback.onRoomDestroyFailed();
+ }
+ }
}
});
}
- public void destroyRoom(final Conversation conference, final OnRoomDestroy callback) {
- IqPacket request = this.mIqGenerator.destroyRoom(conference);
- sendIqPacket(conference.getAccount(), request, (account, packet) -> {
- if (packet.getType() == IqPacket.TYPE.RESULT) {
- callback.onRoomDestroySucceeded(R.string.destroy_muc_succeed);
- } else {
- callback.onRoomDestroyFailed(R.string.destroy_muc_failed);
- }
- });
- }
private void disconnect(Account account, boolean force) {
if ((account.getStatus() == Account.State.ONLINE)
@@ -4719,9 +4713,9 @@ public class XmppConnectionService extends Service {
}
public interface OnRoomDestroy {
- void onRoomDestroySucceeded(int resId);
+ void onRoomDestroySucceeded();
- void onRoomDestroyFailed(int resId);
+ void onRoomDestroyFailed();
}
public interface OnConversationUpdate {