diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-11-09 17:06:09 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-11-09 17:06:09 +0100 |
commit | cb1a36da7930aaa553ffd525fc9d2d07547d50b9 (patch) | |
tree | a24ea0c29c570dc9e10c0dbd6c7d0766855d4ef0 /src/main/java/eu/siacs/conversations/ui | |
parent | 44de982877c04fadc80be0d377f09fab24a3b74c (diff) | |
parent | 180a0e44084752431d702677d68d06ae82524d33 (diff) |
Merge pull request #642 from SamWhited/accountgetjid
Rework `Account.getJid()' to return full JIDs
Diffstat (limited to '')
11 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java index aa6ed7b4..57152b26 100644 --- a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java @@ -99,7 +99,7 @@ public class ChooseContactActivity extends XmppActivity { data.putExtra("contact", mListItem.getJid().toString()); String account = request.getStringExtra("account"); if (account == null && mListItem instanceof Contact) { - account = ((Contact) mListItem).getAccount().getJid().toString(); + account = ((Contact) mListItem).getAccount().getJid().toBareJid().toString(); } data.putExtra("account", account); data.putExtra("conversation", diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index d480ce40..85c35ecd 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -207,7 +207,7 @@ public class ConferenceDetailsActivity extends XmppActivity { private void populateView() { mAccountJid.setText(getString(R.string.using_account, conversation - .getAccount().getJid())); + .getAccount().getJid().toBareJid())); mYourPhoto.setImageBitmap(avatarService().get( conversation.getAccount(), getPixel(48))); setTitle(conversation.getName()); diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java index 701edb47..7106fcdb 100644 --- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -329,7 +329,7 @@ public class ContactDetailsActivity extends XmppActivity { contactJidTv.setText(contact.getJid().toString()); } accountJidTv.setText(getString(R.string.using_account, contact - .getAccount().getJid())); + .getAccount().getJid().toBareJid())); prepareContactBadge(badge, contact); if (contact.getSystemAccount() == null) { badge.setOnClickListener(onBadgeClick); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index c1306210..c6ec63df 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -106,7 +106,7 @@ public class ConversationActivity extends XmppActivity implements protected String getShareableUri() { Conversation conversation = getSelectedConversation(); if (conversation != null) { - return "xmpp:" + conversation.getAccount().getJid(); + return "xmpp:" + conversation.getAccount().getJid().toBareJid(); } else { return ""; } diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index cc022728..cb7988cb 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -298,7 +298,7 @@ public class ConversationFragment extends Fragment { } else { Account account = message.getConversation().getAccount(); Intent intent = new Intent(activity, EditAccountActivity.class); - intent.putExtra("jid", account.getJid().toString()); + intent.putExtra("jid", account.getJid().toBareJid().toString()); startActivity(intent); } } diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index d1aba067..2344ee4b 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -205,7 +205,7 @@ public class EditAccountActivity extends XmppActivity { if (mAccount!=null) { Intent intent = new Intent(getApplicationContext(), PublishProfilePictureActivity.class); - intent.putExtra("account", mAccount.getJid().toString()); + intent.putExtra("account", mAccount.getJid().toBareJid().toString()); startActivity(intent); } } @@ -223,7 +223,7 @@ public class EditAccountActivity extends XmppActivity { } else { intent = new Intent(getApplicationContext(), PublishProfilePictureActivity.class); - intent.putExtra("account", mAccount.getJid().toString()); + intent.putExtra("account", mAccount.getJid().toBareJid().toString()); intent.putExtra("setup", true); } startActivity(intent); @@ -264,7 +264,7 @@ public class EditAccountActivity extends XmppActivity { } protected boolean accountInfoEdited() { - return (!this.mAccount.getJid().equals( + return (!this.mAccount.getJid().toBareJid().equals( this.mAccountJid.getText().toString())) || (!this.mAccount.getPassword().equals( this.mPassword.getText().toString())); @@ -273,7 +273,7 @@ public class EditAccountActivity extends XmppActivity { @Override protected String getShareableUri() { if (mAccount!=null) { - return "xmpp:"+mAccount.getJid(); + return "xmpp:"+mAccount.getJid().toBareJid(); } else { return ""; } @@ -378,7 +378,7 @@ public class EditAccountActivity extends XmppActivity { } private void updateAccountInformation() { - this.mAccountJid.setText(this.mAccount.getJid().toString()); + this.mAccountJid.setText(this.mAccount.getJid().toBareJid().toString()); this.mPassword.setText(this.mAccount.getPassword()); if (this.jidToEdit != null) { this.mAvatar.setVisibility(View.VISIBLE); diff --git a/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java index 1bde4dcb..011ca0a9 100644 --- a/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java @@ -81,7 +81,7 @@ public class ManageAccountActivity extends XmppActivity { } else { menu.findItem(R.id.mgmt_account_enable).setVisible(false); } - menu.setHeaderTitle(this.selectedAccount.getJid().toString()); + menu.setHeaderTitle(this.selectedAccount.getJid().toBareJid().toString()); } @Override diff --git a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java index 371102ef..10ee0cd5 100644 --- a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java @@ -187,7 +187,7 @@ public class PublishProfilePictureActivity extends XmppActivity { } else { loadImageIntoPreview(avatarUri); } - this.accountTextView.setText(this.account.getJid().toString()); + this.accountTextView.setText(this.account.getJid().toBareJid().toString()); } } diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 4963d38d..2b357d0d 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -574,7 +574,7 @@ public class StartConversationActivity extends XmppActivity { this.mActivatedAccounts.clear(); for (Account account : xmppConnectionService.getAccounts()) { if (account.getStatus() != Account.STATUS_DISABLED) { - this.mActivatedAccounts.add(account.getJid().toString()); + this.mActivatedAccounts.add(account.getJid().toBareJid().toString()); } } this.mKnownHosts = xmppConnectionService.getKnownHosts(); diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 4bd64411..e8a858c0 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -277,14 +277,14 @@ public abstract class XmppActivity extends Activity { public void switchToContactDetails(Contact contact) { Intent intent = new Intent(this, ContactDetailsActivity.class); intent.setAction(ContactDetailsActivity.ACTION_VIEW_CONTACT); - intent.putExtra("account", contact.getAccount().getJid().toString()); + intent.putExtra("account", contact.getAccount().getJid().toBareJid().toString()); intent.putExtra("contact", contact.getJid().toString()); startActivity(intent); } public void switchToAccount(Account account) { Intent intent = new Intent(this, EditAccountActivity.class); - intent.putExtra("jid", account.getJid().toString()); + intent.putExtra("jid", account.getJid().toBareJid().toString()); startActivity(intent); } diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java index ea527360..d0ba3374 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java @@ -31,7 +31,7 @@ public class AccountAdapter extends ArrayAdapter<Account> { view = inflater.inflate(R.layout.account_row, parent, false); } TextView jid = (TextView) view.findViewById(R.id.account_jid); - jid.setText(account.getJid().toString()); + jid.setText(account.getJid().toBareJid().toString()); TextView statusView = (TextView) view.findViewById(R.id.account_status); ImageView imageView = (ImageView) view.findViewById(R.id.account_image); imageView.setImageBitmap(activity.avatarService().get(account, |