YesNoOk
avatar

Fix for additional icons (Read 3252 times)

Started by Targaff, July 30, 2007, 15:41:31

0 Members and 1 Guest are viewing this.
#1
Fix for additional icons |
July 30, 2007, 15:41:31
There's a line at clcmsgs.c line #70 that reads as follows:-

Quote
if(contact->bIsMeta && LOWORD(lParam) != EIMG_EXTRA && LOWORD(lParam) != EIMG_CLIENT)
    return 0;

My understanding is that this limits the icons that can be added to a metacontact on the CList to either an "extra" icon or a "client" icon, however, this causes problems in that it prevents some plugins from adding their icons to a metacontact (I know for example that a workaround was added to ShowGender for this, and I think Flags has this problem).  Given that removing this line would appear to fix that issue, would there be any adverse effects from doing so?  And if not, would you be amenable to removing it?

Thanks!
#2
Re: Fix for additional icons |
August 24, 2007, 21:47:50
Sorry to bump, but this appears to have been overlooked?

I can confirm having had the chance to try a build kindly provided by an IRC contact that removing this line does indeed fix the problem stated, and I don't seem to have experienced any serious side effects (i thought I had one, but it turned out to be Firefox being crap at just the wrong time...).  I'd still be interested in your view on this?
#3
Re: Fix for additional icons |
August 24, 2007, 23:38:09
The purpose of this filter is to avoid duplicate/overwriting certain icons with some older plugins.

Actually, clist_nicer forwards extra icons from subcontacts to the master contact automatically and if that doesn't work with some plugins, the reason is that they set icons directly for the metacontact (which they shouldn't - they should apply them to the subcontact).
__
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to a single instruction that doesn't work.
My SMF-based forum fork
#4
Re: Fix for additional icons |
August 28, 2007, 01:36:50
post on wrong topic.
#5
Re: Fix for additional icons |
September 06, 2007, 14:27:34
clist_nicer forwards extra icons from subcontacts to the master contact automatically and if that doesn't work with some plugins, the reason is that they set icons directly for the metacontact (which they shouldn't - they should apply them to the subcontact).

Can you think of any examples of plugins that do this in the way you describe?  I use a slew of plugins that deal with extra icons, and I haven't found one yet that does.

In any event, I didn't think this was how metacontacts worked: my understanding was that it acquires or is passed the relevant db information from its subcontacts and it is from that received information, not the subcontact directly, that the extra icons are generated.  I have used Gender[1] and flags, for example, and have never set a corresponding value directly for a metacontact in relation to either of those, but even though the metacontact clearly has the information - you can see that from the database - the relevant images are not being displayed.  So either metacontacts doesn't work in that way, or the extra icons aren't being transferred properly.

By the same token, can you think of an instance where the additional line prevents a problem that would otherwise occur?

[1] Actually Gender plugin has a workaround for precisely this problem now.
#6
Re: Fix for additional icons |
September 06, 2007, 14:42:18
In any event, I didn't think this was how metacontacts worked: my understanding was that it acquires or is passed the relevant db information from its subcontacts and it is from that received information, not the subcontact directly, that the extra icons are generated.  I have used Gender[1] and flags, for example, and have never set a corresponding value directly for a metacontact in relation to either of those, but even though the metacontact clearly has the information - you can see that from the database - the relevant images are not being displayed.  So either metacontacts doesn't work in that way, or the extra icons aren't being transferred properly.
Well, like I said. Plugins should apply extra icons to the subcontact. Then it will work like it should, because metacontacts plugin copies the settings to the master contact and the clist "forwards" the info to the mastercontact aswell. If plugins fail to do so, they should be considered buggy. The reason is simple: In clist_modern, metacontacts are expandable - if a plugin sets extra image for the master contact only, the subcontact would not show the icon.

A meta contact should never have its own settings but should inherit everything from its subcontacts. The meta contacts plugin does exactly this, but some other plugins are not handling metacontacts properly.

In fact, all my extra icons, including client and flags, are fully working for all my metacontacts. The code part which you quoted in the op is there to prevent plugins from overwriting extra icons at mastercontact level (which they shouldn't do in any way).

__
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to a single instruction that doesn't work.
My SMF-based forum fork
Last Edit: September 06, 2007, 14:44:37 by Nightwish
#7
Re: Fix for additional icons |
September 07, 2007, 09:40:01
Some more on this:

A few older plugins which add extra icons behave wrongly, because they are not aware of metacontacts. They properly set the the icon for the subcontact but may later *overwrite* it for the master contact, because the master contact lacks the necessary information. One example can be the mBirthday plugin which will, in some cases, clear the icon from the master contact when the master contact does not have the birthday information set in its db record. The problem is that this scenario is not predictable, because it depends on the order in which contacts are processed - if the subcontact is processed later, the icon may appear, otherwise it can be overwritten.

The metacontacts protocol copies most database settings from the current subcontact to the master contact - unfortunately, not everything (and that isn't a bug, it's just not possible for non-standard contact settings to be copied, because there may be a lot of plugin-specific settings in a contacts db record).

I'am currently testing a version without the code above, and so far there are no problems with it - but that's probably because I do not use older plugins which add extra icons. All the plugins I use are probably aware how to handle metactontacts properly.
__
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to a single instruction that doesn't work.
My SMF-based forum fork
#8
Re: Fix for additional icons |
October 03, 2007, 18:46:29
Well the version you uploaded to the FL works fine and dandy (as did the contrib from one of the PR builds, incidentally - 9 or 10?), but the contribs from all of the other pre-0.7 problems did not.  Is the one on the file listing this newer test version, or is there some discrepancy between the contrib and your FL version?
#9
Re: Fix for additional icons |
October 03, 2007, 19:13:54
Well the version you uploaded to the FL works fine and dandy (as did the contrib from one of the PR builds, incidentally - 9 or 10?), but the contribs from all of the other pre-0.7 problems did not.  Is the one on the file listing this newer test version, or is there some discrepancy between the contrib and your FL version?

The version on the FL is the latest and includes this code. The prerelease versions did not, because this code was not submitted as a "critical" fix for 0.7.
__
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to a single instruction that doesn't work.
My SMF-based forum fork