Show toast after destroying group chat
This commit is contained in:
parent
b6be7415f6
commit
68d8a7cf45
3 changed files with 10 additions and 8 deletions
|
@ -2892,11 +2892,12 @@ public class XmppConnectionService extends Service {
|
|||
});
|
||||
}
|
||||
|
||||
public void destroyMuc(Conversation mSelectedConversation) {
|
||||
public void destroyMuc(final Conversation mSelectedConversation) {
|
||||
destroyConference(mSelectedConversation, new XmppConnectionService.OnDestroyMuc() {
|
||||
@Override
|
||||
public void OnDestroyMucSuccessful() {
|
||||
public void OnDestroyMucSuccessful(int resId) {
|
||||
Log.d(Config.LOGTAG, "Destroy succeed");
|
||||
showErrorToastInUi(resId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2911,9 +2912,9 @@ public class XmppConnectionService extends Service {
|
|||
IqPacket request = this.mIqGenerator.destroyConference(conference);
|
||||
sendIqPacket(conference.getAccount(), request, (account, packet) -> {
|
||||
if (packet.getType() == IqPacket.TYPE.RESULT) {
|
||||
callback.OnDestroyMucSuccessful();
|
||||
callback.OnDestroyMucSuccessful(R.string.destroy_muc_succeed);
|
||||
} else {
|
||||
callback.OnDestroyMucFailed(R.string.failed);
|
||||
callback.OnDestroyMucFailed(R.string.destroy_muc_failed);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4286,7 +4287,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public interface OnDestroyMuc {
|
||||
void OnDestroyMucSuccessful();
|
||||
void OnDestroyMucSuccessful(int resId);
|
||||
|
||||
void OnDestroyMucFailed(int resId);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
public void onClick(View v) {
|
||||
final AlertDialog.Builder DestroyMucDialog = new AlertDialog.Builder(ConferenceDetailsActivity.this);
|
||||
DestroyMucDialog.setNegativeButton(getString(R.string.cancel), null);
|
||||
DestroyMucDialog.setTitle(getString(R.string.action_destroy_muc));
|
||||
DestroyMucDialog.setTitle(getString(R.string.destroy_muc));
|
||||
DestroyMucDialog.setMessage(getString(R.string.destroy_muc_text, mConversation.getName()));
|
||||
DestroyMucDialog.setPositiveButton(getString(R.string.delete), (dialogInterface, i) -> {
|
||||
Intent intent = new Intent(xmppConnectionService, ConversationActivity.class);
|
||||
|
|
|
@ -752,8 +752,9 @@
|
|||
<string name="invalid_muc_nick">Invalid nickname</string>
|
||||
<string name="title_activity_share_via_account">Share via account</string>
|
||||
<string name="private_messages_are_disabled">Private messages are disabled</string>
|
||||
<string name="destroy_muc">Delete conference</string>
|
||||
<string name="destroy_muc">Destroy group chat</string>
|
||||
<string name="conference_unknown_error">You are no longer in this group chat</string>
|
||||
<string name="action_destroy_muc">Destroy group chat</string>
|
||||
<string name="destroy_muc_text">Would you like to destroy the group chat %s? This will remove this group chat permanently.</string>
|
||||
<string name="destroy_muc_succeed">Group chat successfully destroyed</string>
|
||||
<string name="destroy_muc_failed">Group chat could not be destroyed</string>
|
||||
</resources>
|
||||
|
|
Reference in a new issue