Show
Ignore:
Timestamp:
11/30/06 05:39:56 (2 years ago)
Author:
erijo
Message:

Patch from Anders Olofsson to add option to hide "user has joined/left conversation" messages. Closes #1442.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt-gui/src/ewidgets.cpp

    r4791 r4792  
    712712    m_appendLineBreak = m->m_chatAppendLineBreak; 
    713713  } 
     714  m_showNotices = m->m_showNotices; 
    714715  m_colorRcv = m->m_colorRcv; 
    715716  m_colorSnt = m->m_colorSnt; 
     
    762763    m_appendLineBreak = m->m_chatAppendLineBreak; 
    763764  } 
     765  m_showNotices = m->m_showNotices; 
    764766  m_colorRcv = m->m_colorRcv; 
    765767  m_colorSnt = m->m_colorSnt; 
     
    10841086void CMessageViewWidget::addNotice(QDateTime dt, QString messageText) 
    10851087{ 
     1088  if (!m_showNotices) 
     1089    return; 
     1090 
    10861091  QString color = m_colorNotice.name(); 
    10871092  QString s = ""; 
    10881093  const QString dateTime = dt.toString( m_nDateFormat ); 
    10891094 
    1090   /* Remove trailing line breaks. */ 
    1091   for (unsigned int i = messageText.length() - 1; i >= 0; i--) 
    1092   { 
    1093     if (messageText.at(i) == '\n' || messageText.at(i) == '\r') 
     1095  // Remove trailing line breaks. 
     1096  for (int i = messageText.length(); i >= 0; i--) 
     1097  { 
     1098    if (messageText.at(i - 1) != '\n' && messageText.at(i - 1) != '\r') 
     1099    { 
    10941100      messageText.truncate(i); 
    1095     else 
    1096       break; 
    1097   } 
    1098  
     1101      break; 
     1102    } 
     1103  } 
    10991104 
    11001105  switch (m_nMsgStyle)