After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 368644 - GossipAccount should have an "id" property
GossipAccount should have an "id" property
Status: RESOLVED FIXED
Product: gossip
Classification: Deprecated
Component: General
0.18
Other All
: Normal normal
: ---
Assigned To: Gossip Maintainers
Gossip Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-01 01:25 UTC by Eitan Isaacson
Modified: 2006-11-16 09:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (15.06 KB, patch)
2006-11-01 01:27 UTC, Eitan Isaacson
needs-work Details | Review
updated to last HEAD (16.58 KB, patch)
2006-11-15 23:57 UTC, Xavier Claessens
none Details | Review
check for compatibility with old accounts.xml files (17.21 KB, patch)
2006-11-16 00:35 UTC, Xavier Claessens
none Details | Review

Description Eitan Isaacson 2006-11-01 01:25:20 UTC
Please describe the problem:
Xavier recently generalized GossipAccount's parameters, the "id" parameter should become static again since it is anyway hard-coded in many parts.
Besides the protocol specific code and widgets (GossipAccountWidgetJabber), account parameter names should not be accessed directly in the code.

In the Telepathy branch I will have this property set to the string returned when examining the user's own handle. This way it will not be CM-specific, and should work no matter what the actual protocol parameters are.

Steps to reproduce:



Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Eitan Isaacson 2006-11-01 01:27:39 UTC
Created attachment 75747 [details] [review]
proposed patch

I might have missed a few more references to "id" in the tree.
Comment 2 Xavier Claessens 2006-11-01 08:12:48 UTC
I don't really understand, the "account" param won't be used anymore in the telepathy branch ? you will get this information somewhere else (in the handle) ?

I'm not sure this should be static. When I changed GossipAccount my idea was to keep static user-preferences like the account's name and the auto-connection... Everything protocol-specific should be dynamic. My opinion is the code in gossip where we assume the id exists should be changed with something like

if (gossip_account_has_param (account, "id")){
     blah
}

I'm not sure this is the right way, but it's my initial idea for GossipAccount.

btw, the static proxy things should be removed and become dynamic.
Comment 3 Eitan Isaacson 2006-11-01 18:32:20 UTC
Every CM is free to use any parameter names it chooses, it is only recommended that they use specific names like "account". A rogue developer could use a name like "login" or "screenname". More realistically, the CM telepathy-salut does not even have any parameters that the user is required to use. So the assumption that _any_ parameter exists is wrong.

Gossip depends on the "id" parameter a lot. Philosophically speaking, I think it is safe to assume that in 98% of the cases a protocol will have a unique name for the user. But it is not safe to assume that every connection manager will have that name under the "account" parameter. A much safer way of retrieving that name is by examining the user's own handle (GetSelfHandle followed by InspectHandles).

The account parameters in GossipAccount should only be used for protocol-specific parameters at connection time. Besides these parameters there are a few static GObject properties that are supposed to be universal to any account type: "name", "auto-connect", and as of this proposal, "id".

Yes, the proxy thing should not be static :)
Comment 4 Xavier Claessens 2006-11-15 23:57:18 UTC
Created attachment 76689 [details] [review]
updated to last HEAD

The patch seems ok to me, ok to commit ?
Comment 5 Xavier Claessens 2006-11-16 00:35:51 UTC
Created attachment 76693 [details] [review]
check for compatibility with old accounts.xml files
Comment 6 Mikael Hallendal 2006-11-16 01:06:58 UTC
Fixed some issues in the patch and commited (went in as two commits as I had already reviewed the on under comment #4 when I saw the new one.

Thanks!
Comment 7 Martyn Russell 2006-11-16 09:09:07 UTC
Mmm, I was going to ask why this is needed?

I mean before we had a generalisation for the "id" parameter and that it is not necessary, I don't really see what has changed accept that we now have the old API back?

Surely it makes sense to leave it the way it was? Or have I misunderstood?
Comment 8 Mikael Hallendal 2006-11-16 09:28:55 UTC
I consider a real API better than a string based one for anything that we know will be around all the time. Since the ID is the identifier for a specific account it makes sense to have it as part of the API rather than a generic prototype. I think any property that is required by Gossip should be made into a GObject property rather than an ad-hoc property.

Using GObject properties and a C API ensures that we catch the cases where the plugin developers (or Gossip code) typos "id" or uses the wrong name entirely.