Forwarding messages to ChatWindow
Added stringview as status feedback
This commit is contained in:
parent
ff80897441
commit
3a8af7c9f9
|
@ -50,11 +50,14 @@ ChatWindow::ChatWindow(ContactLinker* cl)
|
|||
AddCommonFilter(new EditingFilter(fSendView));
|
||||
fSendView->MakeFocus(true);
|
||||
|
||||
fStatus = new BStringView("status", "");
|
||||
|
||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 10)
|
||||
.Add(scrollViewReceive, 2)
|
||||
.Add(scrollViewSend)
|
||||
.Add(fStatus)
|
||||
.SetInsets(5, 5, 5, 5)
|
||||
);
|
||||
|
||||
|
@ -116,6 +119,14 @@ ChatWindow::ImMessage(BMessage* msg)
|
|||
fReceiveView->AppendOtherMessage(message.String());
|
||||
break;
|
||||
}
|
||||
case IM_CONTACT_STARTED_TYPING:
|
||||
fStatus->SetText("Buddy is typing ...");
|
||||
break;
|
||||
|
||||
case IM_CONTACT_STOPPED_TYPING:
|
||||
fStatus->SetText("");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <Window.h>
|
||||
#include <TextView.h>
|
||||
#include <StringView.h>
|
||||
#include "Observer.h"
|
||||
|
||||
#include "CayaConstants.h"
|
||||
|
@ -32,6 +33,8 @@ private:
|
|||
BTextView* fSendView;
|
||||
ContactLinker* fContactLinker;
|
||||
CayaRenderView* fReceiveView;
|
||||
BStringView* fStatus;
|
||||
|
||||
};
|
||||
|
||||
#endif // _CHAT_WINDOW_H
|
||||
|
|
|
@ -274,6 +274,8 @@ Server::ImMessage(BMessage* msg)
|
|||
break;
|
||||
}
|
||||
case IM_MESSAGE_RECEIVED:
|
||||
case IM_CONTACT_STARTED_TYPING:
|
||||
case IM_CONTACT_STOPPED_TYPING:
|
||||
{
|
||||
BString id = msg->FindString("id");
|
||||
if (id.Length() > 0) {
|
||||
|
|
Ŝarĝante…
Reference in New Issue