[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:20:30 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=505d35f
The following commit has been merged in the master branch:
commit 505d35f7e820afaf13d223f5cef8ad0f37a97162
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Wed Dec 7 21:00:37 2011 +0100
Write alias changes to the chat view only if the aliases really change --> less useless noise in chat view
Reviewed-by: David Edmundson
CCBUG: 287399
---
lib/chat-widget.cpp | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 8b336f8..e28d52e 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -61,6 +61,8 @@ public:
bool isGroupChat;
int unreadMessages;
QString title;
+ QString contactName;
+ QString yourName;
Tp::TextChannelPtr channel;
Tp::AccountPtr account;
Ui::ChatWidget ui;
@@ -118,6 +120,9 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
d->ui.contactsView->setModel(d->contactModel);
+ d->yourName = channel->groupSelfContact()->alias();
+ d->contactName = channel->targetContact()->alias();
+
d->ui.chatArea->load((d->isGroupChat?AdiumThemeView::GroupChat:AdiumThemeView::SingleUserChat));
AdiumThemeHeaderInfo info;
@@ -786,12 +791,18 @@ void ChatWidget::onContactAliasChanged(const Tp::ContactPtr & contact, const QSt
bool isYou = (contact == d->channel->groupSelfContact());
if (isYou) {
- message = i18n("You are now known as %1", alias);
+ if (d->yourName != alias) {
+ message = i18n("You are now known as %1", alias);
+ d->yourName = alias;
+ }
} else if (!d->isGroupChat) {
//HACK the title is the contact alias on non-groupchats,
//but we should have a better way of keeping the previous
//aliases of all contacts
- message = i18n("%1 is now known as %2", d->title, alias);
+ if (d->contactName != alias) {
+ message = i18n("%1 is now known as %2", d->contactName, alias);
+ d->contactName = alias;
+ }
}
if (!message.isEmpty()) {
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list