Update room subject; accept user_name in OWN_CONTACT_INFO

This commit is contained in:
Jaidyn Ann 2021-06-21 02:32:49 -05:00
parent 0c615b01fd
commit 4ee453d0d6
4 changed files with 20 additions and 1 deletions

View File

@ -257,6 +257,13 @@ Conversation::GetName() const
} }
BString
Conversation::GetSubject() const
{
return fSubject;
}
ConversationView* ConversationView*
Conversation::GetView() Conversation::GetView()
{ {

View File

@ -50,9 +50,11 @@ public:
ProtocolLooper* GetProtocolLooper() const; ProtocolLooper* GetProtocolLooper() const;
void SetProtocolLooper(ProtocolLooper* looper); void SetProtocolLooper(ProtocolLooper* looper);
BString GetName() const;
BString GetSubject() const;
BBitmap* ProtocolBitmap() const; BBitmap* ProtocolBitmap() const;
BBitmap* IconBitmap() const; BBitmap* IconBitmap() const;
BString GetName() const;
ConversationView* GetView(); ConversationView* GetView();
void ShowView(bool typing, bool userAction); void ShowView(bool typing, bool userAction);

View File

@ -250,6 +250,9 @@ Server::ImMessage(BMessage* msg)
if (contact != NULL) { if (contact != NULL) {
contact->GetProtocolLooper()->SetOwnId(contact->GetId()); contact->GetProtocolLooper()->SetOwnId(contact->GetId());
} }
BString name;
if (msg->FindString("user_name", &name) == B_OK)
contact->SetNotifyName(name);
break; break;
} }
case IM_CONTACT_INFO: case IM_CONTACT_INFO:

View File

@ -66,6 +66,12 @@ ConversationView::AttachedToWindow()
BMessage* msg = fMessageQueue.RemoveItemAt(0); BMessage* msg = fMessageQueue.RemoveItemAt(0);
ImMessage(msg); 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; fConversation = chat;
fNameTextView->SetText(chat->GetName()); fNameTextView->SetText(chat->GetName());
fSubjectTextView->SetText(chat->GetSubject());
fProtocolView->SetBitmap(chat->ProtocolBitmap()); fProtocolView->SetBitmap(chat->ProtocolBitmap());
} }