diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-08-17 00:22:21 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-08-17 00:22:21 +0200 |
commit | 6ec7efc36f44dfddff4c9d843cd4c70cffb95837 (patch) | |
tree | 35475563668e508b711517827fba6e2aeb54a0a3 /src/gui/Contact.vala | |
parent | eb4193538b99cf9d49ad0650b1bb816844361ab5 (diff) | |
download | ephraim-6ec7efc36f44dfddff4c9d843cd4c70cffb95837.tar ephraim-6ec7efc36f44dfddff4c9d843cd4c70cffb95837.zip |
Many improvements to roster view
Diffstat (limited to 'src/gui/Contact.vala')
-rw-r--r-- | src/gui/Contact.vala | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/Contact.vala b/src/gui/Contact.vala index 4ced825..512c33f 100644 --- a/src/gui/Contact.vala +++ b/src/gui/Contact.vala @@ -20,6 +20,8 @@ public class Contact : Object { public Contact(string jid0, string? name0) { Object(jid: jid0, name: name0); + subscription = Subscription.NONE; + update_display_string(); } @@ -40,7 +42,7 @@ public class Contact : Object { if (name != null) display_string = name; else - display_string = jid; + display_string = jid.split("@", 2)[0]; } public Gee.Map.Entry<string, Resource>? get_resource_with_highest_priority() { @@ -68,7 +70,15 @@ public class Contact : Object { } public enum Subscription { - BOTH + NONE, PENDING_OUT, PENDING_IN, PENDING_BOTH, TO, TO_PENDING_IN, FROM, FROM_PENDING_OUT, BOTH; + + public bool is_to() { + return (this == TO || this == TO_PENDING_IN || this == BOTH); + } + + public bool is_from() { + return (this == FROM || this == FROM_PENDING_OUT || this == BOTH); + } } public class Resource : Object { |