Set name only if it's a non-empty string and handle IM_EXTENDED_CONTACT_INFO in order to use full name if the contact still don't have a name.

This commit is contained in:
plfiorini 2010-05-28 21:31:53 +00:00
parent 659d45a82c
commit ff80897441

View File

@ -231,7 +231,22 @@ Server::ImMessage(BMessage* msg)
const char* name = NULL;
if (msg->FindString("name", &name) == B_OK)
if ((msg->FindString("name", &name) == B_OK)
&& (strcmp(name, "") != 0))
linker->SetNotifyName(name);
break;
}
case IM_EXTENDED_CONTACT_INFO:
{
ContactLinker* linker = _EnsureContactLinker(msg);
if (linker->GetName().Length() > 0)
return result;
const char* name = NULL;
if ((msg->FindString("full name", &name) == B_OK)
&& (strcmp(name, "") != 0))
linker->SetNotifyName(name);
break;
}