diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-03-10 15:55:13 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2017-04-04 14:43:24 (GMT) |
commit | bd5c623c6e54c1f449b7af06177a9a5c7fbcb4a7 (patch) | |
tree | 1d2d8dba2650f8bdf1eaf3fa649cb82b2a5713ab /Swift/QtUI/Roster | |
parent | ac40889c5466314dd22def238449352a2a4cc67e (diff) | |
download | swift-bd5c623c6e54c1f449b7af06177a9a5c7fbcb4a7.zip swift-bd5c623c6e54c1f449b7af06177a9a5c7fbcb4a7.tar.bz2 |
Open 1:1 chat to real JIDs from MUC rooms (not PMs) when possible
Opens the chat with the user JID instead of the MUC JID.
Does not affect existing behaviour on normal one2one chats.
Test-Information:
Builds on Windows and unit test pass.
Tested the behaviour on single chats from contacts list (roster), start new chat with
one and multiple users. Also tested on MUC rooms that are non-anonymous,
semi-anonymous and anonymous.
Change-Id: I2b8fbacb1fa640167ec196d4215a13ad4905d45c
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp index 1264a09..ac9f541 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.cpp +++ b/Swift/QtUI/Roster/QtTreeWidget.cpp @@ -213,55 +213,54 @@ void QtTreeWidget::handleCollapsed(const QModelIndex& index) { item->setExpanded(false); } } void QtTreeWidget::handleModelItemExpanded(const QModelIndex& index, bool shouldExpand) { if (!index.isValid()) { return; } bool alreadyRight = this->isExpanded(index) == shouldExpand; if (alreadyRight) { return; } setExpanded(index, shouldExpand); } void QtTreeWidget::drawBranches(QPainter*, const QRect&, const QModelIndex&) const { } void QtTreeWidget::show() { QWidget::show(); } void QtTreeWidget::setMessageTarget(MessageTarget messageTarget) { messageTarget_ = messageTarget; } JID QtTreeWidget::jidFromIndex(const QModelIndex& index) const { JID target; if (messageTarget_ == MessageDisplayJID) { target = JID(Q2PSTRING(index.data(DisplayJIDRole).toString())); - target = target.toBare(); } if (!target.isValid()) { target = JID(Q2PSTRING(index.data(JIDRole).toString())); } return target; } JID QtTreeWidget::selectedJID() const { QModelIndexList list = selectedIndexes(); if (list.size() != 1) { return JID(); } return jidFromIndex(list[0]); } void QtTreeWidget::setOnline(bool isOnline) { isOnline_ = isOnline; } bool QtTreeWidget::isOnline() const { return isOnline_; } } |