Hi KaKaRoTo :)
Thanks for "all of this is some very well done work" :) also my patch to add
styles and colors in topcw was good :P lol
Ok, now that i know what it was committed (almost all :P) i send a new diffs
to correct other things.
6-1.diff
So here i answer what do you asked me
"why AND if we can load the newpic ? we don't... the user changed his DP,
then it has to be saved.."
So look at the actual code (or the previous one, it's the same about this
problem)
Now we have...
if { $oldPic != $newPic } {
::abook::setContactData $user displaypicfile $newPic
The first thing that now the code done is to set the newPic: well! but i
wrote that code (abook::set.... ) in some "if condition" because there is a
case where we cannot load (because we cannot download) a DP. Just i said
before:
Think when you login as invisible, you enter in this code: " if oldPIC !=
newPIC" then you save the new name of newPIC than... (removing the case of
the first IF) you enter in the else condition where do you have 3
"possibilities". Consider this:
newPIC is not available in our cache, so you try with 2° possibility, but
mystatus is HDN so i cannot do nothing, so i try with 3° possibility if I
have an SB with that user(s)... in almost case (image when you are just
log-in as invisible, you cannot open an SB) that's false. So you register
the newpic but you didn't download it, then when you go inline and that user
change his status when you check " if { $oldPic != $newPic } {" it will be
result false. That's the reason why i said we need to do ::abook:......
$newpic when $oldpic != newpic AND when we can load the DP. :) because, i
repeat, in some cases we cannot load it so we don't have to register the
name of newpic.
8.diff
If you enable the "global alarm" when an user log in you receive two alarms
the first says that the user is now inline and the second say that he
changed his status. But in reality there wasn't a status change. This diff
correct this bug showing an alarm saying that the user is inline with status
(online, away, etc...)
Just to talk:
Personally i don't like alarm, i found some bugs in particular if i don't
enable "play a sound" it simply doesn't work. Then it's almost useless it
can be a plugin... we have event when an user login, logout and changestate.
My plugin "Contact Monitor" checks when an user change his/her status, nick,
psm, song. It will be easy to create an alert window...
9.diff
We don't need to call events if changestatus is 1 but we are login. It is
also a TODO. so i just put that code in a logic position.
10.diff
We already calculate that value in oldstate variable so it's useless to call
[::abook::getVolatileData $user state FLN]
Sorry for English.
Thanks, bye.
Square87
Index: protocol.tcl
===================================================================
--- protocol.tcl (revisione 9130)
+++ protocol.tcl (copia locale)
@@ -4867,7 +4867,6 @@
set newPic [::MSNP2P::GetFilenameFromMSNOBJ $msnobj]
if { $oldPic != $newPic } {
- ::abook::setContactData $user displaypicfile $newPic
if { $newPic == "" } {
::skin::getDisplayPicture $user 1
@@ -4877,10 +4876,12 @@
if { [file readable "[file join $HOME displaypic cache ${newPic}].png"] } {
#it's possible that the user set again a DP that we already have in our cache so just load it again, even if we are HDN, or the user is blocked.
::MSNP2P::loadUserPic "" $user
+ ::abook::setContactData $user displaypicfile $newPic
} elseif { [::MSN::myStatusIs] != "FLN" && [::MSN::myStatusIs] != "HDN" &&
![::config::getKey lazypicretrieval] && ![::MSN::userIsBlocked $user]} {
set chat_id [::MSN::chatTo $user]
::MSN::ChatQueue $chat_id [list ::MSNP2P::loadUserPic $chat_id $user]
+ ::abook::setContactData $user displaypicfile $newPic
} else {
global sb_list
@@ -4889,6 +4890,7 @@
if { [lsearch $users_in_chat $user] != -1 } {
status_log "User changed image while image in use!! Updating!!\n" white
::MSNP2P::loadUserPic [::MSN::ChatFor $sb] $user
+ ::abook::setContactData $user displaypicfile $newPic
break
}
}
Index: protocol.tcl
===================================================================
--- protocol.tcl (revisione 9130)
+++ protocol.tcl (copia locale)
@@ -4755,7 +4755,13 @@
} elseif { ( [::alarms::isEnabled all] == 1 )&& ( [::alarms::getAlarmItem all ondisconnect] == 1) } {
run_alarm all $user $custom_user_name [trans disconnect $custom_user_name]
}
-
+ } elseif {$oldstate == "FLN"} { ;# the user was offline, now INline
+ set status "[trans [::MSN::stateToDescription $substate]]"
+ if { ( [::alarms::isEnabled $user] == 1 )&& ( [::alarms::getAlarmItem $user onconnect] == 1)} {
+ run_alarm $user $user $custom_user_name "$custom_user_name [trans logsin]\n[trans status]: $status."
+ } elseif { ( [::alarms::isEnabled all] == 1 )&& ( [::alarms::getAlarmItem all onstatus] == 1)} {
+ run_alarm all $user $custom_user_name "$custom_user_name [trans logsin]\n[trans status]: $status."
+ }
} else {
set status "[trans [::MSN::stateToDescription $substate]]"
if { ( [::alarms::isEnabled $user] == 1 )&& ( [::alarms::getAlarmItem $user onstatus] == 1) } {
@@ -4845,13 +4851,6 @@
[::abook::getContactData $user notifyonline -1] == 1) } {
::amsn::notifyAdd "$short_name\n[trans logsin]." "::amsn::chatUser $user" online online $user
}
-
- if { ( [::alarms::isEnabled $user] == 1 )&& ( [::alarms::getAlarmItem $user onconnect] == 1)} {
- run_alarm $user $user $custom_user_name "$custom_user_name [trans logsin]"
- } elseif { ( [::alarms::isEnabled all] == 1 )&& ( [::alarms::getAlarmItem all onstatus] == 1)} {
- run_alarm all $user $custom_user_name "$custom_user_name [trans logsin]"
- }
-
}
}
Index: protocol.tcl
===================================================================
--- protocol.tcl (revisione 9130)
+++ protocol.tcl (copia locale)
@@ -4699,15 +4699,6 @@
set state_changed 0
}
- # we shouldn't add ChangeState PostEvent if ILN
- if { $state_changed } {
- #an event used by guicontactlist to know when a contact changed state
- after 500 [list ::Event::fireEvent contactStateChange protocol $user]
-
- ::plugins::PostEvent ChangeState evpar
- }
-
-
if { $msnobj == "" } {
set msnobj -1
}
@@ -4744,9 +4735,13 @@
set custom_user_name [::abook::getDisplayNick $user]
- #alarm system (that must replace the one that was before) - KNO
if {[lindex $recv 0] !="ILN" && $state_changed} {
+ #an event used by guicontactlist to know when a contact changed state
+ after 500 [list ::Event::fireEvent contactStateChange protocol $user]
+ ::plugins::PostEvent ChangeState evpar
+
+ #alarm system (that must replace the one that was before) - KNO
if {[lindex $recv 0] == "FLN"} {
#User disconnected
Index: protocol.tcl
===================================================================
--- protocol.tcl (revisione 9130)
+++ protocol.tcl (copia locale)
@@ -4802,7 +4802,7 @@
# User was online before, so it's just a status change, and it's not
# an initial state notification
- } elseif {[::abook::getVolatileData $user state FLN] != "FLN" && [lindex $recv 0] != "ILN" } {
+ } elseif {$oldstate != "FLN" && [lindex $recv 0] != "ILN" } {
#Notify in the events
::log::event state $custom_user_name [::MSN::stateToDescription $substate]
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel