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:
parent
659d45a82c
commit
ff80897441
|
@ -231,7 +231,22 @@ Server::ImMessage(BMessage* msg)
|
||||||
|
|
||||||
const char* name = NULL;
|
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);
|
linker->SetNotifyName(name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Ŝarĝante…
Reference in New Issue