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