summaryrefslogtreecommitdiff
path: root/src/contacts-contact-sheet.vala
diff options
context:
space:
mode:
authorErick Pérez Castellanos <erick.red@gmail.com>2012-12-17 15:34:06 -0500
committerErick Pérez Castellanos <erick.red@gmail.com>2012-12-18 16:20:21 -0500
commit319b854f5119a785235fe1fb17cb09a0eb28fe7c (patch)
tree4a109bb7b0c43275952a3e9c7d8896e7b53df23f /src/contacts-contact-sheet.vala
parent5b9052aaeabc9ddee3fd6db552968389e7b05414 (diff)
downloadgnome-contacts-319b854f5119a785235fe1fb17cb09a0eb28fe7c.tar.gz
Show im_addresses of the Contact.
Diffstat (limited to 'src/contacts-contact-sheet.vala')
-rw-r--r--src/contacts-contact-sheet.vala24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/contacts-contact-sheet.vala b/src/contacts-contact-sheet.vala
index a96bcbe..6a91502 100644
--- a/src/contacts-contact-sheet.vala
+++ b/src/contacts-contact-sheet.vala
@@ -117,7 +117,6 @@ public class Contacts.ContactSheet : Grid {
last_store_position = ++i;
}
- /* FIXME: add all of these: postal-addresses */
var details = p as EmailDetails;
if (details != null) {
var emails = Contact.sort_fields<EmailFieldDetails>(details.email_addresses);
@@ -144,6 +143,29 @@ public class Contacts.ContactSheet : Grid {
}
}
+ var im_details = p as ImDetails;
+ if (im_details != null) {
+ foreach (var protocol in im_details.im_addresses.get_keys ()) {
+ foreach (var id in im_details.im_addresses[protocol]) {
+ if (p is Tpf.Persona) {
+ var button = add_row_with_button (ref i, Contact.format_im_service (protocol, null), id.value);
+ button.clicked.connect (() => {
+ var im_persona = c.find_im_persona (protocol, id.value);
+ if (im_persona != null) {
+ var type = im_persona.presence_type;
+ if (type != PresenceType.UNSET &&
+ type != PresenceType.ERROR &&
+ type != PresenceType.OFFLINE &&
+ type != PresenceType.UNKNOWN) {
+ Utils.start_chat (c, protocol, id.value);
+ }
+ }
+ });
+ }
+ }
+ }
+ }
+
var url_details = p as UrlDetails;
if (url_details != null) {
foreach (var url in url_details.urls) {