Do not send empty name in roster push
This commit is contained in:
parent
320738eda8
commit
1c99b634a8
2 changed files with 7 additions and 1 deletions
|
@ -195,6 +195,7 @@ static void handleBuddyPayload(LocalBuddy *buddy, const pbnetwork::Buddy &payloa
|
|||
// Set alias only if it's not empty. Backends are allowed to send empty alias if it has
|
||||
// not changed.
|
||||
if (!payload.alias().empty()) {
|
||||
LOG4CXX_INFO(logger, "Setting alias to " << payload.alias() << " " << buddy->getAlias());
|
||||
buddy->setAlias(payload.alias());
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,12 @@ void RosterManager::sendBuddyRosterPush(Buddy *buddy) {
|
|||
Swift::RosterPayload::ref payload = Swift::RosterPayload::ref(new Swift::RosterPayload());
|
||||
Swift::RosterItemPayload item;
|
||||
item.setJID(buddy->getJID().toBare());
|
||||
item.setName(buddy->getAlias());
|
||||
if (buddy->getAlias().empty()) {
|
||||
item.setName(buddy->getJID().toBare().toString());
|
||||
}
|
||||
else {
|
||||
item.setName(buddy->getAlias());
|
||||
}
|
||||
item.setGroups(buddy->getGroups());
|
||||
item.setSubscription(Swift::RosterItemPayload::Both);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue