aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-10-22 11:20:36 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-10-22 11:20:36 +0200
commit1bd68a42b20949f7880cc8aa51d472e363830c7f (patch)
treebcbd61249491216c0b852bb9bc2316aa0122cc8f /src/main/java/eu/siacs/conversations/services
parent3c45f00443e56557183f94d1152a0847342db510 (diff)
join muc even if initial conference configuration fetch failed
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index ba74280d..cc8f4784 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1683,8 +1683,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
if (account.getStatus() == Account.State.ONLINE || now) {
conversation.resetMucOptions();
fetchConferenceConfiguration(conversation, new OnConferenceConfigurationFetched() {
- @Override
- public void onConferenceConfigurationFetched(Conversation conversation) {
+
+ private void join(Conversation conversation) {
Account account = conversation.getAccount();
final String nick = conversation.getMucOptions().getProposedNick();
final Jid joinJid = conversation.getMucOptions().createJoinJid(nick);
@@ -1723,6 +1723,27 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
getMessageArchiveService().catchupMUC(conversation);
}
}
+
+ @Override
+ public void onConferenceConfigurationFetched(Conversation conversation) {
+ join(conversation);
+ }
+
+ @Override
+ public void onFetchFailed(final Conversation conversation, Element error) {
+ conversation.getMucOptions().setOnJoinListener(new MucOptions.OnJoinListener() {
+ @Override
+ public void onSuccess() {
+ fetchConferenceConfiguration(conversation);
+ }
+
+ @Override
+ public void onFailure() {
+
+ }
+ });
+ join(conversation);
+ }
});
} else {
@@ -1913,6 +1934,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
callback.onConferenceConfigurationFetched(conversation);
}
updateConversationUi();
+ } else if (packet.getType() == IqPacket.TYPE.ERROR) {
+ if (callback != null) {
+ callback.onFetchFailed(conversation, packet.getError());
+ }
}
}
});
@@ -2901,6 +2926,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
public interface OnConferenceConfigurationFetched {
void onConferenceConfigurationFetched(Conversation conversation);
+
+ void onFetchFailed(Conversation conversation, Element error);
}
public interface OnConferenceOptionsPushed {