diff --git a/application/views/ConversationView.cpp b/application/views/ConversationView.cpp index d9b2d3a..f847529 100644 --- a/application/views/ConversationView.cpp +++ b/application/views/ConversationView.cpp @@ -136,9 +136,9 @@ ConversationView::ImMessage(BMessage* msg) case IM_MESSAGE_SENT: case IM_LOGS_RECEIVED: { + _AppendOrEnqueueMessage(msg); if (im_what == IM_MESSAGE_SENT) fReceiveView->ScrollToBottom(); - _AppendOrEnqueueMessage(msg); break; } case IM_ROOM_JOINED: @@ -146,12 +146,14 @@ ConversationView::ImMessage(BMessage* msg) BMessage msg; msg.AddString("body", "** You joined the room.\n"); _AppendOrEnqueueMessage(&msg); + fReceiveView->ScrollToBottom(); } case IM_ROOM_CREATED: { BMessage msg; msg.AddString("body", "** You created the room.\n"); _AppendOrEnqueueMessage(&msg); + fReceiveView->ScrollToBottom(); } case IM_ROOM_PARTICIPANT_JOINED: { @@ -373,6 +375,7 @@ ConversationView::_UserMessage(const char* format, const char* bodyFormat, BMessage newMsg; newMsg.AddString("body", newBody); _AppendOrEnqueueMessage(&newMsg); + fReceiveView->ScrollToBottom(); } diff --git a/libs/librunview/RunView.cpp b/libs/librunview/RunView.cpp index ec1d469..04acb50 100644 --- a/libs/librunview/RunView.cpp +++ b/libs/librunview/RunView.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -98,18 +97,21 @@ RunView::Insert(const char* text, const text_run_array* runs) if (lastEnd < specStart) { BString normie; buf.CopyCharsInto(normie, lastEnd, specStart - lastEnd); - BTextView::Insert(normie.String(), runs); + BTextView::Insert(TextLength(), normie.String(), normie.Length(), + runs); } BString special; buf.CopyCharsInto(special, specStart, specEnd - specStart); - BTextView::Insert(special.String(), &fUrlRun); + BTextView::Insert(TextLength(), special.String(), special.Length(), + &fUrlRun); lastEnd = specEnd; } if (lastEnd < length) { BString remaining; buf.CopyCharsInto(remaining, lastEnd, length - lastEnd); - BTextView::Insert(remaining.String(), runs); + BTextView::Insert(TextLength(), remaining.String(), remaining.Length(), + runs); } }