aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-02-07 21:11:50 +0100
committerChristian Schneppe <christian@pix-art.de>2019-02-07 21:11:50 +0100
commit1b3406cdbb6c620cca975b0bc32b43b60fa246cb (patch)
tree159b4be35bfcc995ba5a8dc2638335bdc998ca9a /src/main/java/de/pixart/messenger/services
parentba4acfd2c11b55373cc856ee48ffb9a56030e6f4 (diff)
provide the same fab submenu for both tabs. rename tab to bookmark
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index e231b2f6c..41b83a76d 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -96,7 +96,6 @@ import de.pixart.messenger.entities.Bookmark;
import de.pixart.messenger.entities.Contact;
import de.pixart.messenger.entities.Conversation;
import de.pixart.messenger.entities.Conversational;
-import de.pixart.messenger.entities.DownloadableFile;
import de.pixart.messenger.entities.Message;
import de.pixart.messenger.entities.MucOptions;
import de.pixart.messenger.entities.MucOptions.OnRenameListener;
@@ -104,8 +103,6 @@ import de.pixart.messenger.entities.Presence;
import de.pixart.messenger.entities.PresenceTemplate;
import de.pixart.messenger.entities.Roster;
import de.pixart.messenger.entities.ServiceDiscoveryResult;
-import de.pixart.messenger.entities.Transferable;
-import de.pixart.messenger.entities.TransferablePlaceholder;
import de.pixart.messenger.generator.AbstractGenerator;
import de.pixart.messenger.generator.IqGenerator;
import de.pixart.messenger.generator.MessageGenerator;
@@ -2673,6 +2670,9 @@ public class XmppConnectionService extends Service {
if (mucOptions.nonanonymous() && !mucOptions.membersOnly() && !conversation.getBooleanAttribute("accept_non_anonymous", false)) {
mucOptions.setError(MucOptions.Error.NON_ANONYMOUS);
updateConversationUi();
+ if (onConferenceJoined != null) {
+ onConferenceJoined.onConferenceJoined(conversation);
+ }
return;
}
final Jid joinJid = mucOptions.getSelf().getFullJid();
@@ -2956,6 +2956,31 @@ public class XmppConnectionService extends Service {
return null;
}
+ public void createPublicChannel(final Account account, final String name, final Jid address, final UiCallback<Conversation> callback) {
+ joinMuc(findOrCreateConversation(account, address, true, false, true), conversation -> {
+ final Bundle configuration = IqGenerator.defaultChannelConfiguration();
+ if (!TextUtils.isEmpty(name)) {
+ configuration.putString("muc#roomconfig_roomname", name);
+ }
+ pushConferenceConfiguration(conversation, configuration, new OnConfigurationPushed() {
+ @Override
+ public void onPushSucceeded() {
+ saveConversationAsBookmark(conversation, name);
+ callback.success(conversation);
+ }
+
+ @Override
+ public void onPushFailed() {
+ if (conversation.getMucOptions().getSelf().getAffiliation().ranks(MucOptions.Affiliation.OWNER)) {
+ callback.error(R.string.unable_to_set_channel_configuration, conversation);
+ } else {
+ callback.error(R.string.joined_an_existing_channel, conversation);
+ }
+ }
+ });
+ });
+ }
+
public boolean createAdhocConference(final Account account,
final String name,
final Iterable<Jid> jids,
@@ -2975,7 +3000,7 @@ public class XmppConnectionService extends Service {
joinMuc(conversation, new OnConferenceJoined() {
@Override
public void onConferenceJoined(final Conversation conversation) {
- final Bundle configuration = IqGenerator.defaultRoomConfiguration();
+ final Bundle configuration = IqGenerator.defaultGroupChatConfiguration();
if (!TextUtils.isEmpty(name)) {
configuration.putString("muc#roomconfig_roomname", name);
}