Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1999 closed enhancement (fixed)

Adjusting priorities for different presence modes

Reported by: anonymous Owned by: asterix
Priority: normal Milestone: 0.11
Component: roster Version: 0.10
Severity: normal Keywords:
Cc: Blocked By:
Blocking: OS:

Description

Hello,

I have a contact who seems to have three gmail accounts. Two are showing him away (1st and 3rd) and the second account is showing him available. However, this contact is away in my roster.

I didn't touch anything about metacontact or something else. I only added in my roster. It seems to me that it's the first account which is read. It should be better than available accounts overwrite this one.

Please tell me if I wasn't clear.

Best Wishes,

Jean-Christophe Jaskula

Attachments (1)

available_but_away.jpg (35.5 KB) - added by Jean-Christophe 10 years ago.
I think it will be helpful

Download all attachments as: .zip

Change History (26)

comment:1 Changed 10 years ago by jim++

So you don't use a metacontact for this contact ?

How can we guess it is the same person and show only the available one ?

comment:2 Changed 10 years ago by dkirov

Let's make it clearer.

Contact can't have accounts, account can have contacts.

Do you have account with 3 contacts in it, or you have 3 accounts ?

comment:3 Changed 10 years ago by Jean-Christophe

When I let my cursor over the name in roster, I have three lines in the

status section showing me three differents status. One was marked available but the contact was away in roster.

I think it shouldn't.

comment:4 Changed 10 years ago by Jean-Christophe

It's really painful. Now the first of three line has signed out but I can

always talk with my friend. (Gajim noticed me that he signed out)

Consequently of this signing out, the little icon in the notification aera indicates a new event and doesn't want to change in the normal icon when I clicked on it.

In the list that I show in the screenshot, there are only two lines with: away and available.

I hope all of this will be helpful.

comment:5 Changed 10 years ago by Jean-Christophe

  • Summary changed from A contact with several accounts is away whereas one of them is showing him available to A contact with

I have just understood that what I called accounts is in reality ressource

I think. My friend was connected with three different computers. Two have away status and the third was available.

So I think it is needed to list all ressources and set status following one well-determined order (with for example online on top)

Is it already done in Gajim ?

Changed 10 years ago by Jean-Christophe

I think it will be helpful

comment:6 Changed 10 years ago by dkirov

Yes, each account can be connected from several resources. Each resource

has a numeric priority. By default all messages are send to the resource with highest priority (protocol definition, we just follow it). In your friend's case, resource with highest priority has status 'away', that's why you see it as away in the roster. Very confusing indeed, but your friend should take care to set the correct priorities, when connecting with several resources.

Setting priority of account in Gajim is not very intuitive. Some users want it to be part of status message dialog, other thinks that this is just another useless control that bloats the interface. Yet we don't have a solution that is good for all and new ideas are welcome. These tickets are related: #1601, #1439, #1885

comment:7 Changed 10 years ago by Jean-christophe Jaskula

  • Summary changed from A contact with several ressources is away whereas one of them is showing him available to A contact with

To my mind, Online status must overwrite highest priority. If someone is

connected and available, it's because if he wants to be available. If he doesn't want, well, he will close his jabber connection when he's aware of it. Almost anybody doesn't take care of priority and above all newbies and "ungeeks". I have just understood what it is and I don't think computers are painful for me. I think priority should be a problem for people who see status and not for the one who set it.

Moreover, it seems that this behaviour introduces a bug in Gajim 0.1O. See my comments about the signing out.

Maybe Gajim should have an option such as : online status overwrite highest priority. What do you think about this ?

comment:8 Changed 10 years ago by Jean-Christophe

  • Priority changed from normal to low
  • Summary changed from A contact with several resources is away whereas one of them is showing him available to Online status
  • Type changed from defect to enhancement

And thanks for the explanations ;-)

If I have time, maybe I will do a patch of what I want.

comment:9 Changed 10 years ago by Jean-Christophe

I have just read some parts of http://www.ietf.org/rfc/rfc3921.txt which

must describe the protocol. It really seems (p84-85) that available resource are prior to they others.

Please tell if I'm wrong but I think that Gajim doesn't respect the protocol on this point.

comment:10 Changed 10 years ago by anonymous

  • Milestone set to 0.11
  • Priority changed from low to normal

comment:11 Changed 10 years ago by Jean-Christophe

  • Cc spacejc@… added

comment:12 Changed 10 years ago by dkirov

I think you are wrong, because 'available resource' is not equivalent to

resource with status 'online'. It is any resource that has presence != 'unavailable' and subscription 'to', or 'both'.

You can try to open XML console (Actions->Advanced -> XML Console && check Enable), or start gajim in verbose mode:

gajim -v

You will see that Gajim is sending the message to the bare jid: <foe@…>, e.g. there is no resource in the jid. Foo's server delivers the message to the resource with highest prio (as described in xmpp).

Jabber server is responsible for selecting the right resource, Gajim just display status of the resource, which is expected to get the message.

comment:13 Changed 10 years ago by Jean-Christophe

Ok... It's confusing and it really doesn't make sense...

Anyway, I have this problem still. But now, I noticed that all priorities are 0. So if I say no mistake, Gajim must decide which is the main resource.

However, my contact is still away. Really confusing...

comment:14 Changed 10 years ago by dkirov

If all resource priorities are the same, then this rule comes into place:

If two or more available resources have the same priority, the server MAY
use some other rule (e.g., most recent connect time, most recent activity
time, or highest availability as determined by some hierarchy of <show/>
values) to choose between them or MAY deliver the message to all such
resources.

In that case, I think Gajim should show the contact as online (a bug!!), but you are not sure that the online resource will be the one to receive your message ( it depends on the server :( ).

IMO the main problem here is your friend's confusion. He/She? doesn't know how to connect several resources at once and how to set priorities. If your friend is using Gajim then we should find a way to make this part more userfriendly. Gossip solution is simple - it lowers the priority with the status change. So if you are online, your status is 50, when you become n/a your status is changed to 30, when you are online again, your status is again 50. Gossip's approach is practical, but it cuts off the protocol, so it is not the best one.

comment:15 Changed 10 years ago by Jean-Christophe

Actually, I think priority should be a number xyz where :

x depends on the status (x is greater when we are online) y is an arbitrary number which describes the preference of the resource.

For example, 50 should be for online at home and 31 for away at work. In this case, online is always prefered and we keep the system of priority.

However, it limits resource to 10 maximum. But we can decide to use number xyz.

Obviously, this scheme should be used by every IM client and I think it's the main problem. It is really a shame that protocol is like that.

What do you think about it ?

comment:16 Changed 10 years ago by Jean-Christophe

I have thought during the night... It is possible to use priority from 0

to 127.

So I think we should divide this in six parts (because Gajim have six status) and let 126 and 127 for any urgency use. Thus from 105 to 125, we are available, from 84 to 104 free for chat, ..., from 0 to 20 invisible. I mean we can choose the order later.

These priorities won't be shown to the user. Indeed, in Edit->account->modify, we can limit priority from 0 to 20. Then internally, we set priority (this one sent to the server) as sum of priority (determined by user) and a status caracteristic number. For instance, if we choose 5 in account modification box and we are available, we will sent 5+105 = 110 as priority to the server.

In this way, we keep the system of priority and the logic of status. For advanced users, we can make something to let them choose priority as they wish.

On an other hand, we don't need server to choose the default resource. We can choose it in Gajim and send message to user@domain/resource_we_choose . It respects rfc and it is more intuitive than the actual way. Obviously, it's a shame not to server but it's more user-friendly and we know what happens.

What do you think about these ideas ?

Best Wishes,

JC

comment:17 Changed 10 years ago by dkirov

It is not a good idea to automatically calculate priorities.

  • Gajim will not be compatible with other jabber clients - if one of your

resources is connected with Gajim and the other with psi the above scheme will fail. Note that there are so many clients and Gajim is used by less than 5% of all jabber users (I'm not sure about the exact stats).

  • Users will not be aware of what their jabber client is doing and some

of us may get angry that Gajim is taking decision, instead of us. If a user somehow understands what is priority, the first thing he will want to do is find a way to set it up. It will be harder for him to understand how the real priority is being computed and some people are scared of maths.

  • userfriendly GUI for making all of these is a hard taks! Each new

control, should be considered very well, because it brings new requirements to the user. The same lasts for hidden, or advanced options. Gajim shouldn't bother users with so many settings.

I think that a better version of your proposal is having priority for each status. By default we can have online priority 50, away 40, n/a 30, busy 20, invisible 10 (similar to Gossip). If these priorities can be easily modified in account modification dialog, then everyone will be able to set up the numbers from your suggestion.

There are so many tickets related to changing status, priority and status message. For each proposal there are more people that don't like it than people who think it is good. Here are some more of them: #1076, #744, #1868

About sending the message to full jid, instead of bare one, see #1143 . Both the client and server are peaces of software. Sending message to the correct resource is server's job. If jabber server is doing something wrong when choosing one from several resources with the same priority, then we should send bug to the developers of this server. Yet, you still can manually specify to which resource the message has to be sent, using context menu on contact row in roster (like in screenshot)

comment:18 Changed 10 years ago by anonymous

  • Cc spacejc@…> added

comment:19 Changed 10 years ago by patrys@…

  • Summary changed from Online status should overwrite priority when Gajim displays status in roster to Adjusting priorities for

comment:20 Changed 10 years ago by nk

I really enjoyed Dimitur's text. I vote for Gossip way.

comment:21 Changed 10 years ago by asterix

why not have that in account modification window:

priority: []set with status current combobox

combobox unsensitive when set with status is checked. This way we don't break too much XMPP protocol (in which status != priority)

default value of set with status can be True (even if I don't like this idea, but is more userfriendly)

comment:22 Changed 10 years ago by nk

you mean do it by default, but leave an option to disable it in UI? okay..

comment:23 Changed 10 years ago by asterix

I have it ready, but I really wonder if we should enable that by default

... any comment ?

comment:24 Changed 10 years ago by asterix

  • Status changed from new to assigned

comment:25 Changed 10 years ago by asterix

  • Status changed from assigned to closed

enabled by default, it's in [ee40ec03704ba68b56393c3f2f6a1b25a78587c8]

Note: See TracTickets for help on using tickets.