aMSN Forums
May 19, 2013, 10:09:25 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: [Plugin] Chat Window Icon  (Read 12865 times)
dpcris85
Newbie

Offline Offline

Posts: 31


View Profile
« on: February 09, 2008, 12:41:47 am »

Hi,
this is a plugin to set the icon of the chat window to the display picture of the contact you are chatting with.

Why this plugin:
This plugin is intended for users that have an icon-based task selector (such as many Linux docks). It can be also useful if in your contact list there are many homonyms.

How does it works:
Enable the plugin. The icon of every chat window will be the display picture of the contact you are chatting with.
If the chat window has tabs, the window icon will be the display picture of the contact which tab is selected.
When the contact changes DP, the icon is automatically updated.
In the case of multiple users chat, the icon will be the normal aMSN icon.
When the plugin is disabled, the chat window icons will revert to the normal aMSN icon.
The plugin has no effect on Mac OS X (obviously).

Requirements:
- aMSN 0.97 (svn revision 8795+, 9564+ for DP change support)
- Tcl/Tk 8.4.8+

Download
Logged

HTH. HAND.
rowanparker
Super Power User
**
Offline Offline

Posts: 235



View Profile WWW
« Reply #1 on: February 09, 2008, 12:03:10 pm »

Just tried it (on Linux).
Works perfectly Smiley
A nice little extra, makes it look even nicer Wink
Good work.
Logged

Daniel15
Super Power User
**
Offline Offline

Posts: 269


View Profile WWW
« Reply #2 on: February 09, 2008, 01:35:21 pm »

Very nice, I like it! Cheesy
Logged

Ubuntu 8.04, Tcl/Tk 8.5, aMSN SVN
My sites: [DanSoft Australia] [Daniel15's Forum and Blog and more...
iron_maiden89b
Newbie

Offline Offline

Posts: 13



View Profile
« Reply #3 on: February 09, 2008, 02:57:22 pm »

Thank you!  Tongue
Logged
Trappski
Super Power User
**
Offline Offline

Posts: 200



View Profile
« Reply #4 on: February 09, 2008, 04:55:31 pm »

Except that some peoples displaypics gets wierd colors when iconized this is a neat little plugin!

Here are an example:


The icon doesn't look very nice upscaled but you get the differences better...

Running aMSN SVN rev 9554 on WinXP
Logged

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #5 on: February 10, 2008, 12:46:11 am »

@dpcris85 : Hey, that's a really cool idea! Thanks for the plugin! Cheesy
@Trappski : yeah, for that, ask tk to fix it...
Logged

KaKaRoTo
Trappski
Super Power User
**
Offline Offline

Posts: 200



View Profile
« Reply #6 on: February 10, 2008, 01:05:27 am »

Quote from: "kakaroto"
@dpcris85 : Hey, that's a really cool idea! Thanks for the plugin! Cheesy
@Trappski : yeah, for that, ask tk to fix it...


Hehe...
I can live with it Tongue
Logged

rowanparker
Super Power User
**
Offline Offline

Posts: 235



View Profile WWW
« Reply #7 on: February 10, 2008, 07:18:09 pm »

Don't know if you can call it a bug but when the user changes picture this isn't reflected in the icon.
Logged

dpcris85
Newbie

Offline Offline

Posts: 31


View Profile
« Reply #8 on: February 11, 2008, 01:55:45 pm »

Quote from: "rowanparker"
Don't know if you can call it a bug but when the user changes picture this isn't reflected in the icon.
I am aware of this issue, but there are currently no plugin events that are fired when an user changes his display picture (at least I have not found any), so I can't fix the problem.
Logged

HTH. HAND.
WM-666
Super Power User
**
Offline Offline

Posts: 292



View Profile WWW
« Reply #9 on: February 11, 2008, 04:48:37 pm »

A subtle and 'little' plugin, but very usefull and nice-looking !
tnx !
Logged

Win7 x64, currently no Ubuntu (will install 10.04)
square87
Super Power User
**
Offline Offline

Posts: 427


View Profile
« Reply #10 on: February 12, 2008, 09:01:35 am »

Hi

I added the plugin event:
plugin event: ChangeDP
variable: user

Bye
Logged
dpcris85
Newbie

Offline Offline

Posts: 31


View Profile
« Reply #11 on: February 13, 2008, 10:44:30 pm »

I updated the plugin implementing the icon change on DP change.
Please download the plugin again if you wish to have this feature.
Logged

HTH. HAND.
square87
Super Power User
**
Offline Offline

Posts: 427


View Profile
« Reply #12 on: February 16, 2008, 07:10:58 am »

Hi Dpcris85 Smiley
I saw you changed the position of that event, but now it's called also when an user didn't change his/her DP (for example everytime we join in a conversation). It's not so good. I think the best solution would be to re-put it in cmsn_change_state but at the end of "if { $oldPic != $newPic } {"

What do you think about?
Thanks, bye.
Logged
dpcris85
Newbie

Offline Offline

Posts: 31


View Profile
« Reply #13 on: February 17, 2008, 01:19:21 am »

Quote from: "square87"
Hi Dpcris85 Smiley
I saw you changed the position of that event, but now it's called also when an user didn't change his/her DP (for example everytime we join in a conversation). It's not so good. I think the best solution would be to re-put it in cmsn_change_state but at the end of "if { $oldPic != $newPic } {"

What do you think about?
Thanks, bye.
Hi square87,
the reason I didn't put the event in cmsn_change_state is because if the config key "lazypicretrieval" is set to false, the new display picture retrieval is not immediately executed, but is delayed, through the use of the ChatQueue procedure (protocol.tcl, 5010-5013)
Because of this, if we fire the event inside the cmsn_change_state procedure, there is the possibility that the event is handled by plugins before the picture is retrieved, and in this case plugins will operate on the old display picture.

About the "event fired when user didn't change his DP", I did some testing to make sure that the event was fired only when appropriate, but maybe I missed something. I'm going to do a little more testing; I will update the post ASAP.

EDIT: After some testing, it seems to me that the issue rises only when the contact is using a default aMSN display picture (or better, a display picture that for some reason is not inside the display picture cache). Can you confirm this? Anyway, if this is correct, then the problem is in the second point of the procedure in which the event is fired (msnp2p.tcl:197). Unfortunately I can't find a way to detect if the display picture changed in a less "hacky" way than the one of the following code:

Code:
} else {
set old_file ""
catch {set old_file [displaypicture_std_$user cget -file]}
::skin::getDisplayPicture $user 1
set new_file [displaypicture_std_$user cget -file]
if {$new_file != $old_file} {
# launch an event for plugins
set evPar(user) $user
::plugins::PostEvent ChangeDP evPar
}
}


Please let me know if the results of my tests are consistent with yours.
Logged

HTH. HAND.
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #14 on: February 17, 2008, 04:58:28 am »

Hi,
I think this might be caused by an old bug... we already know that for some reason, if you right click on a user's DP and select resize to X (anything other than original size), the image gets resized.. if the user leaves the convo then joins.. as soon as we get the 'user joins', the DP is resized to the original size... I think it might be because for some reason we call the function that loads the DP image and that causes the event to be fired.. I'm sure as soon as this bug is fixed (if you wanna fix it, please do it Cheesy) then your current bug will also get fixed.
Logged

KaKaRoTo
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!