From kde-commits Fri Nov 30 22:54:50 2012 From: David Edmundson Date: Fri, 30 Nov 2012 22:54:50 +0000 To: kde-commits Subject: [ktp-text-ui/kde-telepathy-0.5] lib: Correctly emit notifications for messages recieved in an active Message-Id: <20121130225450.EC268A6091 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=135431610118577 Git commit 2aa32aa5db66c3a06d16001ce092c7906e68f844 by David Edmundson. Committed on 30/11/2012 at 23:54. Pushed by davidedmundson into branch 'kde-telepathy-0.5'. Correctly emit notifications for messages recieved in an active chat BUG: 310946 Fixed-In: 0.5.2 M +6 -8 lib/chat-widget.cpp http://commits.kde.org/telepathy-text-ui/2aa32aa5db66c3a06d16001ce092c7906e= 68f844 diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp index bbc8451..bc8f5cd 100644 --- a/lib/chat-widget.cpp +++ b/lib/chat-widget.cpp @@ -709,12 +709,7 @@ void ChatWidget::notifyAboutIncomingMessage(const Tp::= ReceivedMessage & message) //choose the correct notification type: //options are: // kde_telepathy_contact_incoming - // kde_telepathy_contact_incoming_active_window - TODO - requires info= rmation not available yet. - //FIXME: until the above is available, simply deactivate the event - if(isOnTop()) { - kDebug() << "Widget is on top, not doing anything"; - return; - } + // kde_telepathy_contact_incoming_active_window // don't notify of messages sent by self from another computer if (message.sender() =3D=3D d->channel->groupSelfContact()) { return; @@ -734,10 +729,13 @@ void ChatWidget::notifyAboutIncomingMessage(const Tp:= :ReceivedMessage & message) } else if(message.messageType() =3D=3D Tp::ChannelTextMessageTypeNotic= e) { notificationType =3D QLatin1String("kde_telepathy_info_event"); } else { - notificationType =3D QLatin1String("kde_telepathy_contact_incoming= "); + if (isOnTop()) { + notificationType =3D QLatin1String("kde_telepathy_contact_inco= ming_active_window"); + } else { + notificationType =3D QLatin1String("kde_telepathy_contact_inco= ming"); + } } = - KNotification *notification =3D new KNotification(notificationType, th= is, KNotification::RaiseWi= dgetOnActivation | KNotification::Close= WhenWidgetActivated