about summary refs log tree commit diff stats
path: root/src/contact.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-08-31 15:07:05 +0100
committerJames Booth <boothj5@gmail.com>2013-08-31 15:07:05 +0100
commit694e332384a9dc0794c778ce6d6400ae5fa35c20 (patch)
treedbc07c41c208c08bbb73503adff6a0bc401bbab4 /src/contact.c
parent4ae817cd8292f964ef1c45bfa3b70544ce23043f (diff)
downloadprofani-tty-694e332384a9dc0794c778ce6d6400ae5fa35c20.tar.gz
Show only nick or jid in /wins output
Diffstat (limited to 'src/contact.c')
-rw-r--r--src/contact.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/contact.c b/src/contact.c
index 1b566d40..9cc992b2 100644
--- a/src/contact.c
+++ b/src/contact.c
@@ -156,6 +156,16 @@ p_contact_name(const PContact contact)
     return contact->name;
 }
 
+const char *
+p_contact_name_or_jid(const PContact contact)
+{
+    if (contact->name != NULL) {
+        return contact->name;
+    } else {
+        return contact->barejid;
+    }
+}
+
 static Resource *
 _highest_presence(Resource *first, Resource *second)
 {
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214