Index: licq/plugins/qt-gui/src/userinfodlg.cpp
===================================================================
--- licq/plugins/qt-gui/src/userinfodlg.cpp	(revision 4782)
+++ licq/plugins/qt-gui/src/userinfodlg.cpp	(working copy)
@@ -1726,7 +1726,7 @@
   l->addWidget(chkHistoryReverse);
 
   mlvHistory = new CMessageViewWidget(m_szId, m_nPPID, mainwin, p, "history");
-  mlvHistory->m_nMsgStyle = 4; /* STYLE_HISTORY */
+  mlvHistory->m_nMsgStyle = 5; /* STYLE_HISTORY */
 
   connect(mlvHistory, SIGNAL(viewurl(QWidget*, QString)), mainwin, SLOT(slot_viewurl(QWidget *, QString)));
 
@@ -2027,7 +2027,18 @@
   barFiltering->setTotalSteps(NUM_MSG_PER_HISTORY);
   char* ftxt = qstrdup(codec->fromUnicode(lneFilter->text()));
   int flen = strlen(ftxt);
-  
+
+  QString ownerName;
+  ICQOwner *o = gUserManager.FetchOwner(m_nPPID, LOCK_R);
+  if (o != NULL)
+  {
+    // Don't use this codec to decode our conversation with the contact
+    // since we're using the contact's encoding, not ours.
+    QTextCodec *ownerCodec = UserCodec::codecForICQUser(o);
+    ownerName = ownerCodec->toUnicode(o->GetAlias());
+    gUserManager.DropOwner(m_nPPID);
+  }
+
   mlvHistory->clear();
   while (m_nHistoryShowing < (NUM_MSG_PER_HISTORY))
   {
@@ -2047,7 +2058,7 @@
                   (*tempIter)->IsMultiRec(),
                   (*tempIter)->IsUrgent(),
                   (*tempIter)->IsEncrypted(),
-                  contactName,
+                  ((*tempIter)->Direction() == D_RECEIVER ? contactName : ownerName),
                   MLView::toRichText(messageText, true, bUseHTML));
       m_nHistoryShowing++;
       barFiltering->setProgress(m_nHistoryShowing);
@@ -2067,6 +2078,10 @@
          break;
     }
   }
+
+  // History view may be buffered so write buffer to output now that all entries has been added
+  mlvHistory->updateContent();
+
   delete [] ftxt;
   if(lneFilter->text().isEmpty())
     lblHistory->setText(tr("[<font color=\"%1\">Received</font>] "
@@ -2089,7 +2104,7 @@
   if(!m_bHistoryReverse)
     mlvHistory->GotoEnd();
   else
-    mlvHistory->setCursorPosition(0, 0);
+    mlvHistory->GotoHome();
   barFiltering->reset();
 }
 
Index: licq/plugins/qt-gui/src/mlview.h
===================================================================
--- licq/plugins/qt-gui/src/mlview.h	(revision 4782)
+++ licq/plugins/qt-gui/src/mlview.h	(working copy)
@@ -31,6 +31,7 @@
 
   void appendNoNewLine(const QString& s);
   void append(const QString& s);
+  void GotoHome();
   void GotoEnd();
 
   bool hasMarkedText() const;
Index: licq/plugins/qt-gui/src/mlview.cpp
===================================================================
--- licq/plugins/qt-gui/src/mlview.cpp	(revision 4782)
+++ licq/plugins/qt-gui/src/mlview.cpp	(working copy)
@@ -156,6 +156,11 @@
   return text;
 }
 
+void MLView::GotoHome()
+{
+  setContentsPos(0, 0);
+}
+
 void MLView::GotoEnd()
 {
   moveCursor(QTextBrowser::MoveEnd, false);
Index: licq/plugins/qt-gui/src/ewidgets.h
===================================================================
--- licq/plugins/qt-gui/src/ewidgets.h	(revision 4782)
+++ licq/plugins/qt-gui/src/ewidgets.h	(working copy)
@@ -197,6 +197,7 @@
   unsigned long m_nPPID;
   unsigned long m_nUin;
   CMainWindow *mainwin;
+  QString m_buffer;
 public:
   CMessageViewWidget(const char *szId, unsigned long nPPID,
     CMainWindow *m, QWidget *parent = 0, const char *name = 0);
@@ -205,6 +206,8 @@
   virtual ~CMessageViewWidget();
 
   void setOwner(const char *szId);
+  void updateContent();
+  void clear();
   void addMsg(direction dir, bool fromHistory, QString eventDescription, QDateTime date, 
     bool isDirect, bool isMultiRec, bool isUrgent, bool isEncrypted, 
     QString contactName, QString messageText);
@@ -213,6 +216,7 @@
   unsigned short m_nMsgStyle;
   QString m_nDateFormat;
   bool m_bAppendLineBreak;
+  bool m_useBuffer;
   QColor m_colorRcvHistory;
   QColor m_colorSntHistory;
   QColor m_colorRcv;
Index: licq/plugins/qt-gui/src/ewidgets.cpp
===================================================================
--- licq/plugins/qt-gui/src/ewidgets.cpp	(revision 4782)
+++ licq/plugins/qt-gui/src/ewidgets.cpp	(working copy)
@@ -745,6 +745,29 @@
   m_szId = strdup(_szId);
 }
 
+void CMessageViewWidget::clear()
+{
+  CHistoryWidget::clear();
+
+  m_buffer = "<html><body>";
+  switch(m_nMsgStyle)
+  {
+    case 5:
+      m_buffer.append("<table border=\"0\">");
+      m_useBuffer = true;
+      break;
+    default:
+      m_useBuffer = false;
+  }
+}
+
+void CMessageViewWidget::updateContent()
+{
+  if (m_useBuffer == false)
+    return;
+  setText(m_buffer);
+}
+
 void CMessageViewWidget::addMsg(ICQEvent * _e)
 {
   if (strcmp(_e->Id(), m_szId) == 0 && _e->PPID() == m_nPPID &&
@@ -864,12 +887,33 @@
                   .arg(color)
                   .arg(messageText));
     break;     
+
+    case 5:
+      // Mode 5 is a table so it cannot be displayed in paragraphs
+      s = QString("<tr><td><nobr><b><font color=\"%1\">%2</font><b></nobr></td>")
+                  .arg(color)
+                  .arg(my_date);
+      s.append(QString("<td><b><font color=\"%3\">%4</font></b></font></td>")
+                       .arg(color)
+                       .arg(contactName));
+      s.append(QString("<td><font color=\"%1\">%2</font></td></tr>")
+                      .arg(color)
+                      .arg(messageText));
+      break;
   }
-  
-  append(s);
-  if (m_bAppendLineBreak) {
-    append("<hr>");
+
+  if (m_useBuffer)
+  {
+    m_buffer.append(s);
+    if (m_bAppendLineBreak)
+      m_buffer.append("<hr>");
   }
+  else
+  {
+    append(s);
+    if (m_bAppendLineBreak)
+      append("<hr>");
+  }
 }
 
 void CMessageViewWidget::addMsg(CUserEvent* e, const char *_szId, unsigned long _nPPID)
@@ -988,6 +1032,14 @@
                   .arg(messageText);
       break; 
 
+    case 5:
+      s = QString("<tr><td><b><font color=\"%1\">%2</font><b></td><td colspan=\"2\"><b><font color=\"%3\">%4</font></b></font></td></tr>")
+                  .arg(color)
+                  .arg(dateTime)
+                  .arg(color)
+                  .arg(messageText);
+      break;
+
     case 0:
     default:
       s = QString("<html><body><font color=\"%1\"><b>[%2] %3</b></font><br></body></html>")
@@ -997,9 +1049,18 @@
       break;    
   }
 
-  append(s);
-  if (m_bAppendLineBreak)
-    append("<hr>");
+  if (m_useBuffer)
+  {
+    m_buffer.append(s);
+    if (m_bAppendLineBreak)
+      m_buffer.append("<hr>");
+  }
+  else
+  {
+    append(s);
+    if (m_bAppendLineBreak)
+      append("<hr>");
+  }
 }
 
 CLicqMessageBox::CLicqMessageBox(QWidget *parent)
