Hi, I think you're doing it a bit wrong, You should have an event in PutLog and in StartLog too, so in StartLog you can write your line saying that you are starting a convo with a user with nickname : $long_nickname then in Putlog you can crop the user's nick, but you don't need a variable like AmIusingput_log because you can just use evpar and do a set user [string range $user 0 9] and you're done, the $user variable will also be changed in put_log, so there you go, you have your nickname cropped (making sure that $failled == 0) ! Also, the AmIusingput_log... I really hate this variable's name, can you make it into something like "plugin_cancel_put_log" or something easier to understand ? But I really don't think it's something necessary... If you want to remove the ":" from the message, you can set a variable at the begining of the proc : set separator ":" so you can set that variable to an empty string inside your plugin to remove the ":" and put this instead in the writeLog calls : ::log::WriteLog $chatid "\|\"LITA$user $separator\|\"L$color $msg\n" 0 $chatid instead of ::log::WriteLog $chatid "\|\"LITA$user :\|\"L$color $msg\n" 0 $chatid
Can you also please finish the whole work, and finish your plugin before sending any more diffs, I don't want to have a diff sent every hour and whenever you advance in your code you realize you needed to change something else (for example in StartLog or whatever). If you want to send the diff to have my advice of how you're doing things, if it's good or not, then no problem, as long as it's clear that the diff is for review, and not for being committed. Thanks, KaKaRoTo On Sat, Feb 03, 2007 at 06:18:48PM +0100, square87 wrote: > Here I am. > Now it should work correctly :) > What do you think? > Thanks > Index: loging.tcl > =================================================================== > --- loging.tcl (revisione 7904) > +++ loging.tcl (copia locale) > @@ -273,29 +273,39 @@ > set color "RED" > # When the message failed to deliver, we should show > the deliverfail message instead of the user's nickname. > set user [trans deliverfail] > - } > - > - if {[::OIM_GUI::IsOIM $chatid]} { > - ::log::WriteLog $chatid "\|\"LITA$user :\|\"L$color > $msg\n" 0 $chatid > - } else { > - set user_list [::MSN::usersInChat $chatid] > - foreach user_info $user_list { > - set user_login [lindex $user_info 0] > - if { [llength $user_list] > 1 } { > - ::log::WriteLog $user_login > "\|\"LITA$user :\|\"L$color $msg\n" 1 $user_list > - } else { > - # for 2 windows (1 priv 1 conf) > - # if conf exists for current user & > current chatid is not a conf > - if { [ConfArray $user_login get] == 1 > && $chatid == $user_login} { > - ::log::WriteLog $user_login > "\|\"LITA\[[trans linprivate]\] $user :\|\"L$color $msg\n" 2 $user_list > + } > + > + set evPar(chatid) chatid > + set evPar(user) user > + set evPar(msg) msg > + set evPar(fontformat) fontformat > + set evPar(failed) failed > + set evPar(color) color > + set AmIusingput_log 0 > + set evPar(AmIusingput_log) AmIusingput_log > + ::plugins::PostEvent put_log evPar > + if {$AmIusingput_log==0} { > + if {[::OIM_GUI::IsOIM $chatid]} { > + ::log::WriteLog $chatid "\|\"LITA$user > :\|\"L$color $msg\n" 0 $chatid > + } else { > + set user_list [::MSN::usersInChat $chatid] > + foreach user_info $user_list { > + set user_login [lindex $user_info 0] > + if { [llength $user_list] > 1 } { > + ::log::WriteLog $user_login > "\|\"LITA$user :\|\"L$color $msg\n" 1 $user_list > } else { > - ::log::WriteLog $user_login > "\|\"LITA$user :\|\"L$color $msg\n" 0 $user_list > + # for 2 windows (1 priv 1 conf) > + # if conf exists for current > user & current chatid is not a conf > + if { [ConfArray $user_login > get] == 1 && $chatid == $user_login} { > + ::log::WriteLog > $user_login "\|\"LITA\[[trans linprivate]\] $user :\|\"L$color $msg\n" 2 > $user_list > + } else { > + ::log::WriteLog > $user_login "\|\"LITA$user :\|\"L$color $msg\n" 0 $user_list > + } > } > } > } > } > } > - > > > #/////////////////////////////////////////////////////////////////////////////// > # WriteLog (email txt (conf) (userlist)) > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Amsn-devel mailing list > Amsn-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/amsn-devel ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel