Bug 54676 - set preferred methods of messaging
Summary: set preferred methods of messaging
Status: RESOLVED WORKSFORME
Alias: None
Product: kopete
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: VLO wishlist
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 62439 88920 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-15 14:12 UTC by David Findlay
Modified: 2011-12-16 12:15 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
priorities.diff (26.65 KB, text/x-diff)
2004-01-08 01:03 UTC, Jason Keirstead
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Findlay 2003-02-15 14:12:54 UTC
Version:           0.5.8cvs >= 20030131 (using KDE 3.1.0)
Installed from:     (testing/unstable)
Compiler:          gcc version 3.2.2 20030131 (Debian prerelease)
OS:          Linux (i686) release 2.4.20

It would be useful to be able to set a preferred order of protocols to use if a particular meta-contact is available by more than one protocol. Thanks,

David
Comment 1 Olivier Goffart 2003-03-03 20:43:00 UTC
Soon, it will be an identity order. 
Currently, it is the contact which has the best importance() wich is take 
(i.e. if one is away, and another online, the online one is take) 
Comment 2 Will Stephenson 2003-06-11 00:49:54 UTC
Maybe we could define an ordering which includes both criteria?  Sort by 
status/importance(), then by account order, and message the first in the 
resulting list?  We could sort the contact smallicons in the contactlistview 
the same way. 
Comment 3 Olivier Goffart 2003-08-23 13:57:25 UTC
Subject: kdenonbeta/kopete

CVS commit by ogoffart: 

Make the ordering of accounts working in libkpoete.
use this account order to find the preferred contact in a metacontact with multiple contact.

!!!!*****FIXME***TODO*****!!!
The account order is still not saved in the KConfig file.
KConfig does not give dirrect way (AFAIK) to save an order, unlike the old XML saving.
I still donn't know how I (or others?) will implement the saving of this order.

CCMAIL: 62439@bugs.kde.org 
CCMAIL: 54676@bugs.kde.org


  M +12 -3     kopete/conf/accountconfig.cpp   1.18
  M +21 -0     libkopete/kopeteaccountmanager.cpp   1.30
  M +15 -0     libkopete/kopeteaccountmanager.h   1.17
  M +8 -1      libkopete/kopetemetacontact.cpp   1.169



Comment 4 Jason Keirstead 2003-10-10 03:58:47 UTC
This functionality still doesnt work and IMO should be fixed  for 3.2. I mean for 
petes sake we have had this on the "todo" list since pre-0.6 
 
As for saving the account order, you could just add a new field under the root 
kopete config with the account ids in a  comma delimited string to save the 
order. Or any other method. 
 
 
Comment 5 Casey Allen Shobe 2003-10-10 04:10:29 UTC
*** Bug 62439 has been marked as a duplicate of this bug. ***
Comment 6 Martijn Klingens 2003-10-10 12:46:46 UTC
Subject: Re: [Kopete-devel]  set preferred methods of messaging

On Friday 10 October 2003 03:58, Jason Keirstead wrote:
> This functionality still doesnt work and IMO should be fixed  for
> 3.2. I mean for petes sake we have had this on the "todo" list since
> pre-0.6

It should be fixed for sure, but probably after 3.2.

I'm afraid for regressions otherwise.

If you're going to fix it before, please post a diff to the list first, I want 
to be absolutely sure it is safe to go in at this point.

Comment 7 Olivier Goffart 2003-10-11 02:44:51 UTC
Subject: Re: [Kopete-devel]  set preferred methods of messaging

Le Vendredi 10 Octobre 2003 03:58, Jason Keirstead a 
Comment 8 Jason Keirstead 2003-11-21 04:46:31 UTC
I say pre-0.6 because evrn before there were accounts, we had no way of choosing the preferred messaging protocol. There is even a very large, rather old comment in KopeteMetaContact about this.
Comment 9 Olivier Goffart 2003-11-21 16:02:25 UTC
> I say pre-0.6 because evrn before there were accounts

Yeah that's true, it's even pre-0.5 , i remember this was discussded when we introduced the metacontact concept
Comment 10 Jason Keirstead 2004-01-06 04:44:18 UTC
Is there any progress on this bug yet?

It's voted very high, has been around for 2 years, and seems so simple to do. I would implement it myself as I described above but I am not sure others agreed that was the best way to store the information.

Seems to me all you have to do is make a QStringList of the accountIds and save that, since QStringList is ordered and KConfig supports it.

We're getting down to the wire here timewise to fix this major issue before the big 3.2 release.
Comment 11 Martijn Klingens 2004-01-06 06:54:24 UTC
Subject: Re: [Kopete-devel]  set preferred methods of messaging

On Tuesday 06 January 2004 04:44, Jason Keirstead wrote:
> Seems to me all you have to do is make a QStringList of the accountIds and
> save that, since QStringList is ordered and KConfig supports it.

Without a GUI or without strings though, but yes, that seems like what we 
need.

Patches welcome :)

Speaking about those, I can't remember seeing diffs of a lot of non-trivial 
commits that went in lately. Where's the 'send patches for approval before 
commit' policy gone?

Comment 12 Olivier Goffart 2004-01-06 09:24:21 UTC
The only missing stuff is to save the order in the account config and to load them.

The UI has been there, but has been removed because it was not correctly saved.
Comment 13 Jason Keirstead 2004-01-06 13:32:48 UTC
The GUI is already there and has been there for like a year. The up and down arrows in the account dialog are supposed to set the priorities of the accounts, that was the whole purpose of them.

Right now they do *nothing*.
Comment 14 Jason Keirstead 2004-01-06 13:38:37 UTC
Actually it just came ot me theres an even simpler way to do this.

When you hit save, you just iterate through the QListView and add a property to the account "priority" that is it's position in the listview. Then in the preferredContact function in KopeteMetaContact you just check as well if thisAccount->priority() > nextAccount->priority() while going through the contacts and checking if their KOS > other KOS.
Comment 15 Jason Keirstead 2004-01-06 13:39:40 UTC
Oh, and when you load the accounts into the QListView you can have a priority property  that you sort by that doesn't show on the list. Like how the members list sorts by status.
Comment 16 Olivier Goffart 2004-01-06 14:10:12 UTC
> The GUI is already there and has been there for like a year. The up and down
> arrows in the account dialog are supposed to set the priorities of the 
> accounts, that was the whole purpose of them.

They have been removed.  anyway, the code is still there.

> Right now they do *nothing*. 

They change the order of the QPtrList account are ordered in libkopete.  This order is used bu the algoritm in KopeteMetaContact::prefferedContact() , and in few others algoritm.

Comment 17 Jason Keirstead 2004-01-06 14:21:08 UTC
Subject: Re: [Kopete-devel]  set preferred methods of messaging

On January 06, 2004 9:10 am, Olivier Goffart wrote:
> They change the order of the QPtrList account are ordered in libkopete.
>  This order is used bu the algoritm in
> KopeteMetaContact::prefferedContact() , and in few others algoritm.

But but this order isn't saved to disk, you can't write out a ptrlist to disk.

Comment 18 Martijn Klingens 2004-01-06 17:04:36 UTC
Subject: Re: [Kopete-devel]  set preferred methods of messaging

On Tuesday 06 January 2004 14:21, Jason Keirstead wrote:
> > They change the order of the QPtrList account are ordered in libkopete.
> >  This order is used bu the algoritm in
> > KopeteMetaContact::prefferedContact() , and in few others algoritm.
>
> But but this order isn't saved to disk, you can't write out a ptrlist to
> disk.

Correct. There are other places where it matters though. Ideally the 
preferences is also taken into account when ordering the account icons in the 
status bar and the systray popup menu, and in the small contact icons in the 
contact list for instance.

Now all those are cosmetic changes, whereas not having the sorting at all is 
much graver. AFAICS just fixing preferredContact to use

On Tuesday 06 January 2004 13:38, Jason Keirstead wrote:
> When you hit save, you just iterate through the QListView and add a
> property to the account "priority" that is it's position in the listview.
> Then in the preferredContact function in KopeteMetaContact you just check
> as well if thisAccount->priority() > nextAccount->priority() while going
> through the contacts and checking if their KOS > other KOS.

should be ok.

As an aside:

On Tuesday 06 January 2004 13:39, Jason Keirstead wrote:
> Oh, and when you load the accounts into the QListView you can have
> a priority property  that you sort by that doesn't show on the list.

While this is true...

> Like how the members list sorts by status.

... this is not. The members list is sorted by using reimplemented sorting 
methods on the list view items.

But that doesn't mean that your proposed hidden column doesn't work. It might 
make KListView ::setFullWidth break though, let me know the results on that 
one.

Comment 19 Jason Keirstead 2004-01-08 01:03:16 UTC
Subject: Re: [Kopete-devel]  set preferred methods of messaging

Attached is a patch to implement account priorities in Kopete. It:

- Adds the Up / Down buttons back again
- Adds a "Priority" field to KopeteAccount
- Maintains the QPtrList of accounts in KopeteAccountManager sorted by priority
- Maintains the statusbar icons sorted by priority
- Uses the priority for preferredContact when messaging
- Fixes this bug!

Because the QPtrList is sorted, it also means the accounts in the systray menu
are also sorted. I don't know of anywhere else the sorting would be appropriate.

I'd like to be able to add "Increase Priority", "Decrease Priority" instead of "Up", "Down"
for the button tooltips, but that'd break freeze. They will just have to be explained in the
documentation.

Someone please review, I'd like to commit this for 3.2





Created an attachment (id=4038)
priorities.diff
Comment 20 Jason Keirstead 2004-01-09 22:45:37 UTC
Subject: kdenetwork/kopete

CVS commit by brunes: 

Account Priorities patch. We need to ensure that the purpose of these
up / down buttons is in the documentation, since it probably is not very
clear from the UI, and I could not add proper tooltip descriptions

CCMAIL:54676-done@bugs.kde.org


  M +38 -20    kopete/kopetewindow.cpp   1.169
  M +10 -4     kopete/kopetewindow.h   1.61
  M +54 -34    kopete/config/accounts/kopeteaccountconfig.cpp   1.12
  M +1 -6      kopete/config/accounts/kopeteaccountconfig.h   1.4
  M +49 -9     kopete/config/accounts/kopeteaccountconfigbase.ui   1.8
  M +14 -1     libkopete/kopeteaccount.cpp   1.78
  M +14 -2     libkopete/kopeteaccount.h   1.42
  M +20 -25    libkopete/kopeteaccountmanager.cpp   1.41
  M +6 -13     libkopete/kopeteaccountmanager.h   1.19



Comment 21 Martijn Klingens 2004-01-09 23:14:41 UTC
It's a bit nitpicking, but as a reminder that we should still add strings after CVS is open for string changes I reopened the wish.

I'm not convinced that we will remember to do this otherwise. :(

Martijn
Comment 22 P. Varet 2004-01-20 22:02:24 UTC
As of 3.2.0rc1, the UI to move protocols/accounts up and down has been restored. However, it DOESN'T seem to affect Kopete's choice of transport when I click on a contact. No matter how I organize my protocols, Yahoo gets picked first (even when the contact is set available on all his transports). Is this a bug in the bugfix, or am I doing something wrong?
Comment 23 Jason Keirstead 2004-01-20 23:15:40 UTC
Confirmed. This got broken again? How?

*shakes fist at Kopete*

Comment 24 Olivier Goffart 2004-03-12 22:14:34 UTC
It seems working fine.
Of course, it still prefer take the "most online" contact if any, but if contacts has the same online status, the preferred protocol is selected.
Comment 25 P. Varet 2004-03-14 16:30:04 UTC
Thank you, Olivier. This was fixed in KDE 3.2.1.
Comment 26 Olivier Goffart 2004-09-06 11:59:45 UTC
*** Bug 88920 has been marked as a duplicate of this bug. ***
Comment 27 Davide Castellone 2008-11-23 22:39:41 UTC
This problem reappeared after KDE 4.0. In the configuration dialog I cannot choose which protocol to prefer, though it worked in previous versions.
Comment 28 Murz 2009-08-23 12:24:57 UTC
This problem is still exists in KDE 4.3... maybe will better to open a new bug?
Comment 29 Murz 2010-01-25 09:27:09 UTC
In KDE 4.4 RC2 I can drag Accounts in Kopete Configure window and this successfully change the priority of protocols!
But will be good to change priority of accounts per each contacts!
For example, metacontact have 2 icq accounts and 3 jabber. I want to set the priority order:
1 - jabber1
2 - icq2
3 - icq1
4 - jabber3
5 - jabber2
Comment 30 M. P. Čtyři 2010-02-26 17:02:08 UTC
I can confirm this problem exists in Kopete 4.3.2, 4.3.3, and 4.3.5.

Is there a separate, open bug report for this issue in Kopete 4? If not, can this one be reopened, or cross-referenced to #84108?