fixed bug where presence requests where sent on display of contact details

This commit is contained in:
iNPUTmice 2014-07-21 15:17:01 +02:00
parent aa844df144
commit 87aff4c6d8
1 changed files with 5 additions and 2 deletions

View File

@ -173,9 +173,7 @@ public class ContactDetailsActivity extends XmppActivity {
status = (TextView) findViewById(R.id.details_contactstatus);
lastseen = (TextView) findViewById(R.id.details_lastseen);
send = (CheckBox) findViewById(R.id.details_send_presence);
send.setOnCheckedChangeListener(this.mOnSendCheckedChange);
receive = (CheckBox) findViewById(R.id.details_receive_presence);
receive.setOnCheckedChangeListener(this.mOnReceiveCheckedChange);
badge = (QuickContactBadge) findViewById(R.id.details_contact_badge);
keys = (LinearLayout) findViewById(R.id.details_contact_keys);
getActionBar().setHomeButtonEnabled(true);
@ -232,6 +230,8 @@ public class ContactDetailsActivity extends XmppActivity {
}
private void populateView() {
send.setOnCheckedChangeListener(null);
receive.setOnCheckedChangeListener(null);
setTitle(contact.getDisplayName());
if (contact.getOption(Contact.Options.FROM)) {
send.setText(R.string.send_presence_updates);
@ -267,6 +267,9 @@ public class ContactDetailsActivity extends XmppActivity {
send.setEnabled(false);
}
send.setOnCheckedChangeListener(this.mOnSendCheckedChange);
receive.setOnCheckedChangeListener(this.mOnReceiveCheckedChange);
lastseen.setText(UIHelper.lastseen(getApplicationContext(),
contact.lastseen.time));