diff --git a/chatdialog.cpp b/chatdialog.cpp
index c7d8725..3bc518d 100644
--- a/chatdialog.cpp
+++ b/chatdialog.cpp
@@ -1,9 +1,61 @@
 #include <QtGui>
 #include "chatdialog.h"
+#include <ctime>
 
 ChatDialog::ChatDialog(QWidget *parent)
   : QDialog(parent)
 {
   setupUi(this);
   lineEdit->setFocusPolicy(Qt::StrongFocus);
+
+
+  connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
+}
+
+void
+ChatDialog::appendMessage(const SyncDemo::ChatMessage &msg) 
+{
+  if (msg.from().isEmpty || message.msgData().isEmpty())
+    return;
+
+  QTextCursor cursor(textEdit->textCursor());
+  cursor.movePosition(QTextCursor::End);
+  QTextTableFormat tableFormat;
+  tableFormat.setBorder(0);
+  QTextTable *table = cursor.insertTable(1, 2, tableFormat);
+  table->cellAt(0, 0).firstCursorPosition().insertText("<" + msg.from() + ">: ");
+  table->cellAt(0, 1).firstCursorPosition().insertText(msg.msgData());
+  QScrollBar *bar = textEdit->verticalScrollBar();
+  bar->setValue(bar->maximum());
+}
+
+void 
+ChatDialog::updateTreeView() 
+{
+}
+
+void 
+ChatDialog::returnPressed()
+{
+  QString text = lineEdit->text();
+  if (text.isEmpty())
+    return;
+ 
+  SyncDemo::ChatMessage msg;
+  formChatMessage(text, msg);
+  
+  // TODO:
+  // send message
+  appendMessage(msg);
+  updateTreeView();
+
+}
+
+void
+ChatDialog::formChatMessage(const QString &text, SyncDemo::ChatMessage &msg) {
+  msg.set_from(m_nick);
+  msg.set_to(m_chatroom);
+  msg.set_msgData(text);
+  time_t seconds = time(NULL);
+  msg.set_timestamp(seconds);
 }
