Search in sources :

Example 11 with Bookmark

use of eu.siacs.conversations.entities.Bookmark in project Conversations by siacs.

the class StartConversationActivity method deleteConference.

protected void deleteConference() {
    int position = conference_context_id;
    final Bookmark bookmark = (Bookmark) conferences.get(position);
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setNegativeButton(R.string.cancel, null);
    builder.setTitle(R.string.delete_bookmark);
    builder.setMessage(getString(R.string.remove_bookmark_text, bookmark.getJid()));
    builder.setPositiveButton(R.string.delete, new OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            bookmark.unregisterConversation();
            Account account = bookmark.getAccount();
            account.getBookmarks().remove(bookmark);
            xmppConnectionService.pushBookmarks(account);
            filter(mSearchEditText.getText().toString());
        }
    });
    builder.create().show();
}
Also used : AlertDialog(android.app.AlertDialog) Account(eu.siacs.conversations.entities.Account) Bookmark(eu.siacs.conversations.entities.Bookmark) DialogInterface(android.content.DialogInterface) OnClickListener(android.content.DialogInterface.OnClickListener) SuppressLint(android.annotation.SuppressLint)

Example 12 with Bookmark

use of eu.siacs.conversations.entities.Bookmark in project Conversations by siacs.

the class StartConversationActivity method openConversationForBookmark.

protected void openConversationForBookmark(int position) {
    Bookmark bookmark = (Bookmark) conferences.get(position);
    openConversationsForBookmark(bookmark);
}
Also used : Bookmark(eu.siacs.conversations.entities.Bookmark)

Aggregations

Bookmark (eu.siacs.conversations.entities.Bookmark)12 Account (eu.siacs.conversations.entities.Account)7 Jid (eu.siacs.conversations.xmpp.jid.Jid)4 Conversation (eu.siacs.conversations.entities.Conversation)3 Element (eu.siacs.conversations.xml.Element)3 SuppressLint (android.annotation.SuppressLint)2 AlertDialog (android.app.AlertDialog)2 MucOptions (eu.siacs.conversations.entities.MucOptions)2 IqPacket (eu.siacs.conversations.xmpp.stanzas.IqPacket)2 PendingIntent (android.app.PendingIntent)1 ActivityNotFoundException (android.content.ActivityNotFoundException)1 DialogInterface (android.content.DialogInterface)1 OnClickListener (android.content.DialogInterface.OnClickListener)1 Intent (android.content.Intent)1 SpannableString (android.text.SpannableString)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 AutoCompleteTextView (android.widget.AutoCompleteTextView)1 CheckBox (android.widget.CheckBox)1 Checkable (android.widget.Checkable)1