diff --git a/application/Conversation.cpp b/application/Conversation.cpp index f4fd354..71e409a 100644 --- a/application/Conversation.cpp +++ b/application/Conversation.cpp @@ -257,6 +257,13 @@ Conversation::GetName() const } +BString +Conversation::GetSubject() const +{ + return fSubject; +} + + ConversationView* Conversation::GetView() { diff --git a/application/Conversation.h b/application/Conversation.h index 7018bba..52bf805 100644 --- a/application/Conversation.h +++ b/application/Conversation.h @@ -50,9 +50,11 @@ public: ProtocolLooper* GetProtocolLooper() const; void SetProtocolLooper(ProtocolLooper* looper); + BString GetName() const; + BString GetSubject() const; + BBitmap* ProtocolBitmap() const; BBitmap* IconBitmap() const; - BString GetName() const; ConversationView* GetView(); void ShowView(bool typing, bool userAction); diff --git a/application/Server.cpp b/application/Server.cpp index 0a1cef4..5e7b07e 100644 --- a/application/Server.cpp +++ b/application/Server.cpp @@ -250,6 +250,9 @@ Server::ImMessage(BMessage* msg) if (contact != NULL) { contact->GetProtocolLooper()->SetOwnId(contact->GetId()); } + BString name; + if (msg->FindString("user_name", &name) == B_OK) + contact->SetNotifyName(name); break; } case IM_CONTACT_INFO: diff --git a/application/views/ConversationView.cpp b/application/views/ConversationView.cpp index 5455554..cb6b363 100644 --- a/application/views/ConversationView.cpp +++ b/application/views/ConversationView.cpp @@ -66,6 +66,12 @@ ConversationView::AttachedToWindow() BMessage* msg = fMessageQueue.RemoveItemAt(0); ImMessage(msg); } + if (fConversation != NULL) { + if (fNameTextView->Text() != fConversation->GetName()) + fNameTextView->SetText(fConversation->GetName()); + if (fSubjectTextView->Text() != fConversation->GetSubject()) + fSubjectTextView->SetText(fConversation->GetSubject()); + } } @@ -206,6 +212,7 @@ ConversationView::SetConversation(Conversation* chat) { fConversation = chat; fNameTextView->SetText(chat->GetName()); + fSubjectTextView->SetText(chat->GetSubject()); fProtocolView->SetBitmap(chat->ProtocolBitmap()); }