diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-08-03 20:42:05 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-08-03 20:42:05 +0200 |
commit | 629ff3afcdba5e6721a1b63cd0d497d97e3bdbed (patch) | |
tree | 6e536f1070c72d895fb87721f6c3a864de5a3716 /src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java | |
parent | 5073069adbc3fb88618d670b5cefa2cb2c2be19b (diff) |
proper account send to publish avatar activity
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java index 0e369a97a..776ed7741 100644 --- a/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java +++ b/src/eu/siacs/conversations/ui/PublishProfilePictureActivity.java @@ -11,6 +11,7 @@ import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import eu.siacs.conversations.R; +import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.utils.PhoneHelper; public class PublishProfilePictureActivity extends XmppActivity { @@ -24,6 +25,8 @@ public class PublishProfilePictureActivity extends XmppActivity { private Uri avatarUri; + private Account account; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -37,7 +40,7 @@ public class PublishProfilePictureActivity extends XmppActivity { @Override public void onClick(View v) { if (avatarUri!=null) { - xmppConnectionService.pushAvatar(null, avatarUri); + xmppConnectionService.pushAvatar(account, avatarUri); finish(); } } @@ -67,7 +70,6 @@ public class PublishProfilePictureActivity extends XmppActivity { protected void onActivityResult(int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); - Log.d("xmppService","on activity result"); if (resultCode == RESULT_OK) { if (requestCode == REQUEST_CHOOSE_FILE) { Log.d("xmppService","bla"); @@ -78,13 +80,19 @@ public class PublishProfilePictureActivity extends XmppActivity { @Override protected void onBackendConnected() { - Log.d("xmppService","on backend connected"); - if (this.avatarUri == null) { - avatarUri = PhoneHelper.getSefliUri(getApplicationContext()); + if (getIntent()!=null) { + String jid = getIntent().getStringExtra("account"); + if (jid!=null) { + this.account = xmppConnectionService.findAccountByJid(jid); + if (this.avatarUri == null) { + avatarUri = PhoneHelper.getSefliUri(getApplicationContext()); + } + loadImageIntoPreview(avatarUri); + String explainText = getString(R.string.publish_avatar_explanation,account.getJid()); + this.explanation.setText(explainText); + } } - loadImageIntoPreview(avatarUri); - String explainText = getString(R.string.publish_avatar_explanation,"daniel@gultsch.de"); - this.explanation.setText(explainText); + } protected void loadImageIntoPreview(Uri uri) { |