fixed some minor NPE
This commit is contained in:
parent
ab57c59838
commit
d963d95e30
|
@ -2551,6 +2551,9 @@ public class XmppConnectionService extends Service {
|
|||
final MucOptions mucOptions = conversation.getMucOptions();
|
||||
|
||||
if (mucOptions.nonanonymous() && !mucOptions.membersOnly() && !conversation.getBooleanAttribute("accept_non_anonymous", false)) {
|
||||
synchronized (account.inProgressConferenceJoins) {
|
||||
account.inProgressConferenceJoins.remove(conversation);
|
||||
}
|
||||
mucOptions.setError(MucOptions.Error.NON_ANONYMOUS);
|
||||
updateConversationUi();
|
||||
if (onConferenceJoined != null) {
|
||||
|
@ -2990,31 +2993,31 @@ public class XmppConnectionService extends Service {
|
|||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||
if (packet.getType() == IqPacket.TYPE.RESULT) {
|
||||
final MucOptions mucOptions = conversation.getMucOptions();
|
||||
final Bookmark bookmark = conversation.getBookmark();
|
||||
final boolean sameBefore = StringUtils.equals(bookmark == null ? null : bookmark.getBookmarkName(), mucOptions.getName());
|
||||
|
||||
final MucOptions mucOptions = conversation.getMucOptions();
|
||||
final Bookmark bookmark = conversation.getBookmark();
|
||||
final boolean sameBefore = StringUtils.equals(bookmark == null ? null : bookmark.getBookmarkName(), mucOptions.getName());
|
||||
if (mucOptions.updateConfiguration(new ServiceDiscoveryResult(packet))) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": muc configuration changed for " + conversation.getJid().asBareJid());
|
||||
updateConversation(conversation);
|
||||
}
|
||||
|
||||
if (mucOptions.updateConfiguration(new ServiceDiscoveryResult(packet))) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": muc configuration changed for " + conversation.getJid().asBareJid());
|
||||
updateConversation(conversation);
|
||||
}
|
||||
|
||||
if (bookmark != null && (sameBefore || bookmark.getBookmarkName() == null)) {
|
||||
if (bookmark.setBookmarkName(StringUtils.nullOnEmpty(mucOptions.getName()))) {
|
||||
pushBookmarks(account);
|
||||
}
|
||||
}
|
||||
if (bookmark != null && (sameBefore || bookmark.getBookmarkName() == null)) {
|
||||
if (bookmark.setBookmarkName(StringUtils.nullOnEmpty(mucOptions.getName()))) {
|
||||
pushBookmarks(account);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (callback != null) {
|
||||
callback.onConferenceConfigurationFetched(conversation);
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.onConferenceConfigurationFetched(conversation);
|
||||
}
|
||||
|
||||
|
||||
|
||||
updateConversationUi();
|
||||
} else if (packet.getType() == IqPacket.TYPE.ERROR) {
|
||||
updateConversationUi();
|
||||
} else if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": received timeout waiting for conference configuration fetch");
|
||||
} else {
|
||||
if (callback != null) {
|
||||
callback.onFetchFailed(conversation, packet.getError());
|
||||
}
|
||||
|
|
|
@ -1552,7 +1552,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
|||
intent = GeoHelper.getFetchIntent(activity);
|
||||
break;
|
||||
}
|
||||
if (intent.resolveActivity(getActivity().getPackageManager()) != null) {
|
||||
final Context context = getActivity();
|
||||
if (context != null && intent.resolveActivity(context.getPackageManager()) != null) {
|
||||
if (chooser) {
|
||||
startActivityForResult(
|
||||
Intent.createChooser(intent, getString(R.string.perform_action_with)),
|
||||
|
|
|
@ -16,6 +16,7 @@ import eu.siacs.conversations.R;
|
|||
import eu.siacs.conversations.databinding.SearchResultItemBinding;
|
||||
import eu.siacs.conversations.http.services.MuclumbusService;
|
||||
import eu.siacs.conversations.ui.util.AvatarWorkerTask;
|
||||
import rocks.xmpp.addr.Jid;
|
||||
|
||||
public class ChannelSearchResultAdapter extends ListAdapter<MuclumbusService.Room, ChannelSearchResultAdapter.ViewHolder> {
|
||||
|
||||
|
@ -61,7 +62,8 @@ public class ChannelSearchResultAdapter extends ListAdapter<MuclumbusService.Roo
|
|||
viewHolder.binding.language.setText(language.toUpperCase(Locale.ENGLISH));
|
||||
viewHolder.binding.language.setVisibility(View.VISIBLE);
|
||||
}
|
||||
viewHolder.binding.room.setText(searchResult.getRoom().asBareJid().toString());
|
||||
final Jid room = searchResult.getRoom();
|
||||
viewHolder.binding.room.setText(room != null ? room.asBareJid().toString() : "");
|
||||
AvatarWorkerTask.loadAvatar(searchResult, viewHolder.binding.avatar, R.dimen.avatar);
|
||||
viewHolder.binding.getRoot().setOnClickListener(v -> listener.onChannelSearchResult(searchResult));
|
||||
}
|
||||
|
|
|
@ -147,6 +147,8 @@ public final class MucDetailsContextMenuHelper {
|
|||
activity.xmppConnectionService.changeAffiliationInConference(conversation, jid, MucOptions.Affiliation.ADMIN, onAffiliationChanged);
|
||||
return true;
|
||||
case R.id.give_membership:
|
||||
case R.id.remove_admin_privileges:
|
||||
case R.id.revoke_owner_privileges:
|
||||
activity.xmppConnectionService.changeAffiliationInConference(conversation, jid, MucOptions.Affiliation.MEMBER, onAffiliationChanged);
|
||||
return true;
|
||||
case R.id.give_owner_privileges:
|
||||
|
@ -155,10 +157,6 @@ public final class MucDetailsContextMenuHelper {
|
|||
case R.id.remove_membership:
|
||||
activity.xmppConnectionService.changeAffiliationInConference(conversation, jid, MucOptions.Affiliation.NONE, onAffiliationChanged);
|
||||
return true;
|
||||
case R.id.remove_admin_privileges:
|
||||
case R.id.revoke_owner_privileges:
|
||||
activity.xmppConnectionService.changeAffiliationInConference(conversation, jid, MucOptions.Affiliation.MEMBER, onAffiliationChanged);
|
||||
return true;
|
||||
case R.id.remove_from_room:
|
||||
removeFromRoom(user, activity, onAffiliationChanged);
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue