This commit is contained in:
iNPUTmice 2014-09-20 16:02:49 +02:00
parent 295bfb7f1d
commit 0b86f65bdc
4 changed files with 60 additions and 43 deletions

View File

@ -275,11 +275,23 @@ public class ConversationFragment extends Fragment {
@Override
public void onContactPictureClicked(Message message) {
if (message.getStatus() <= Message.STATUS_RECEIVED) {
if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
if (message.getPresence() != null) {
highlightInConference(message.getPresence());
} else {
highlightInConference(message.getCounterpart());
highlightInConference(message
.getCounterpart());
}
} else {
Contact contact = message.getConversation()
.getContact();
if (contact.showInRoster()) {
activity.switchToContactDetails(contact);
} else {
activity.showAddToRosterDialog(message
.getConversation());
}
}
}
}
@ -289,6 +301,7 @@ public class ConversationFragment extends Fragment {
@Override
public void onContactPictureLongClicked(Message message) {
if (message.getStatus() <= Message.STATUS_RECEIVED) {
if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
if (message.getPresence() != null) {
privateMessageWith(message.getPresence());
@ -297,6 +310,7 @@ public class ConversationFragment extends Fragment {
}
}
}
}
});
messagesView.setAdapter(messageListAdapter);

View File

@ -62,7 +62,7 @@ public class ManageAccountActivity extends XmppActivity {
@Override
public void onItemClick(AdapterView<?> arg0, View view,
int position, long arg3) {
editAccount(accountList.get(position));
switchToAccount(accountList.get(position));
}
});
registerForContextMenu(accountListView);
@ -163,12 +163,6 @@ public class ManageAccountActivity extends XmppActivity {
}
}
private void editAccount(Account account) {
Intent intent = new Intent(this, EditAccountActivity.class);
intent.putExtra("jid", account.getJid());
startActivity(intent);
}
private void publishAvatar(Account account) {
Intent intent = new Intent(getApplicationContext(),
PublishProfilePictureActivity.class);

View File

@ -248,6 +248,12 @@ public abstract class XmppActivity extends Activity {
startActivity(intent);
}
public void switchToAccount(Account account) {
Intent intent = new Intent(this, EditAccountActivity.class);
intent.putExtra("jid", account.getJid());
startActivity(intent);
}
protected void inviteToConversation(Conversation conversation) {
Intent intent = new Intent(getApplicationContext(),
ChooseContactActivity.class);

View File

@ -406,20 +406,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
return view;
}
if (type == RECEIVED) {
if (item.getConversation().getMode() == Conversation.MODE_MULTI) {
Contact contact = item.getContact();
if (contact != null) {
viewHolder.contact_picture.setImageBitmap(mBitmapCache.get(
contact, getContext()));
} else {
String name = item.getPresence();
if (name == null) {
name = item.getCounterpart();
}
viewHolder.contact_picture.setImageBitmap(mBitmapCache.get(
name, getContext()));
}
if (viewHolder.contact_picture != null) {
viewHolder.contact_picture
.setOnClickListener(new OnClickListener() {
@ -448,6 +435,22 @@ public class MessageAdapter extends ArrayAdapter<Message> {
}
});
}
if (type == RECEIVED) {
if (item.getConversation().getMode() == Conversation.MODE_MULTI) {
Contact contact = item.getContact();
if (contact != null) {
viewHolder.contact_picture.setImageBitmap(mBitmapCache.get(
contact, getContext()));
} else {
String name = item.getPresence();
if (name == null) {
name = item.getCounterpart();
}
viewHolder.contact_picture.setImageBitmap(mBitmapCache.get(
name, getContext()));
}
}
}
if (item.getType() == Message.TYPE_IMAGE) {