summaryrefslogtreecommitdiffstats
blob: f1114ed4106402fc1e6b936b6c2028625df6f5c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Swiften/LinkLocal/LinkLocalService.h"

namespace Swift {

String LinkLocalService::getDescription() const {
	LinkLocalServiceInfo info = getInfo();
	if (!info.getNick().isEmpty()) {
		return info.getNick();
	}
	else if (!info.getFirstName().isEmpty()) {
		String result = info.getFirstName();
		if (!info.getLastName().isEmpty()) {
			result += " " + info.getLastName();
		}
		return result;
	}
	else if (!info.getLastName().isEmpty()) {
		return info.getLastName();
	}
	return getName();
}

JID LinkLocalService::getJID() const {
	return JID(getName());
}

}