[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:03:26 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=9f729f9
The following commit has been merged in the master branch:
commit 9f729f93f41686e6dc161ddf415ceebe1284cf19
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Sun Mar 24 01:51:23 2013 +0000
Make our resourceID more unique
Currently some jabber servers don't allow users to connect from two places with the same resource ID.
This appends the first 6 digits of the hash of their hostname to our current default resource ID
REVIEW: 109686
BUG: 301330
---
plugins/gabble/gabble-account-ui.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/plugins/gabble/gabble-account-ui.cpp b/plugins/gabble/gabble-account-ui.cpp
index 1331a75..02cfce1 100644
--- a/plugins/gabble/gabble-account-ui.cpp
+++ b/plugins/gabble/gabble-account-ui.cpp
@@ -28,6 +28,8 @@
#include "server-settings-widget.h"
#include "proxy-settings-widget.h"
+#include <QHostInfo>
+
#include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
#include <KCMTelepathyAccounts/GenericAdvancedOptionsWidget>
#include <KCMTelepathyAccounts/ParameterEditModel>
@@ -72,8 +74,14 @@ AbstractAccountParametersWidget *GabbleAccountUi::mainOptionsWidget(
QWidget *parent) const
{
QModelIndex resourceIndex = model->indexForParameter(model->parameter(QLatin1String("resource")));
- if (resourceIndex.isValid() && model->data(resourceIndex, ParameterEditModel::ValueRole).toString().isEmpty()) {
- model->setData(resourceIndex, QString::fromLatin1("kde-telepathy"), ParameterEditModel::ValueRole);
+
+ //if gabble still has parameter "resource" and the current value is either empty or the old resource value
+ if (resourceIndex.isValid() && (model->data(resourceIndex, ParameterEditModel::ValueRole).toString().isEmpty() ||
+ model->data(resourceIndex, ParameterEditModel::ValueRole).toString() == QLatin1String("kde-telepathy"))) {
+ //we want to make our resource ID pseudo unique so that you can log in from different machines that all use KTp
+ //we make a hash of the hostname then take the first 6 digits and add that to our ID so there's practically no chance of getting a duplicate
+ QString resourceId = QString::fromLatin1("kde-telepathy-").append(QString::number(qHash(QHostInfo::localHostName()) % 1000000));
+ model->setData(resourceIndex, resourceId, ParameterEditModel::ValueRole);
}
if (m_serviceName == QLatin1String("google-talk")) {
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list