From kde-commits Tue Mar 15 22:33:12 2005 From: Duncan Mac-Vicar Prett Date: Tue, 15 Mar 2005 22:33:12 +0000 To: kde-commits Subject: KDE_3_4_BRANCH: kdenetwork/kopete/kopete/chatwindow Message-Id: <20050315223312.5652D12E73 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=111092600512503 CVS commit by dmacvicar: Backport bugfix: Holding enter sends empty messages CCBUGS: 100334 M +4 -0 chattexteditpart.cpp 1.2.4.1 --- kdenetwork/kopete/kopete/chatwindow/chattexteditpart.cpp #1.2:1.2.4.1 @@ -229,4 +229,8 @@ void ChatTextEditPart::sendMessage() { QString txt = text( Qt::PlainText ); + // avoid sending emtpy messages or enter keys (see bug 100334) + if ( txt.isEmpty() || txt == "\n" ) + return; + if ( m_lastMatch.isNull() && ( txt.find( QRegExp( QString::fromLatin1("^\\w+:\\s") ) ) > -1 ) ) { //no last match and it finds something of the form of "word:" at the start of a line