From ff80897441f6b56c19ec9dbaf936a93e6e2fd5ec Mon Sep 17 00:00:00 2001 From: plfiorini Date: Fri, 28 May 2010 21:31:53 +0000 Subject: [PATCH] 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. --- application/Server.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/application/Server.cpp b/application/Server.cpp index b90a730..8561f33 100644 --- a/application/Server.cpp +++ b/application/Server.cpp @@ -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; }