From: <ba...@us...> - 2008-02-28 17:11:05
|
Revision: 9613 http://amsn.svn.sourceforge.net/amsn/?rev=9613&view=rev Author: baaazen Date: 2008-02-28 09:11:06 -0800 (Thu, 28 Feb 2008) Log Message: ----------- fix for localization-codes with 5 digits and auto-code-detection for users with hotmail-account (thanks to billiob :) ) Modified Paths: -------------- trunk/amsn/msngames.tcl trunk/amsn/preferences.tcl trunk/amsn/protocol.tcl Modified: trunk/amsn/msngames.tcl =================================================================== --- trunk/amsn/msngames.tcl 2008-02-28 16:26:14 UTC (rev 9612) +++ trunk/amsn/msngames.tcl 2008-02-28 17:11:06 UTC (rev 9613) @@ -14,7 +14,8 @@ if {[llength $gameinfo] == 3} { #check if we have a fitting plugin for this game - if {[::MSNGamesPlugins::supportedGame [string range [lindex $gameinfo 0] 4 end]] == 1} { + set appId [string range [lindex $gameinfo 0] [expr [string length [lindex $gameinfo 0]] - 4] end] + if {[::MSNGamesPlugins::supportedGame $appId] == 1} { SendMessageFIFO [list ::MSNGamesGUI::IncomingGameRequestShow $chatid $dest $branchuid $cseq $uid $sid $gameinfo] "::amsn::messages_stack($chatid)" "::amsn::messages_flushing($chatid)" } else { #no plugin found, so warn the user and abort request @@ -141,7 +142,7 @@ setObjOption $sid inviter 0 setObjOption $sid chatid $chatid setObjOption $sid reflector 0 - setObjOption $sid appid [string range [lindex $gameinfo 0] 4 end] + setObjOption $sid appid [string range [lindex $gameinfo 0] [expr [string length [lindex $gameinfo 0]] - 4] end] # Let's make and send a 200 OK Message set slpdata [::MSNP2P::MakeMSNSLP "OK" $dest [::config::getKey login] $branchuid [expr {$cseq + 1}] $uid 0 0 $sid] Modified: trunk/amsn/preferences.tcl =================================================================== --- trunk/amsn/preferences.tcl 2008-02-28 16:26:14 UTC (rev 9612) +++ trunk/amsn/preferences.tcl 2008-02-28 17:11:06 UTC (rev 9613) @@ -3222,8 +3222,8 @@ ::config::setKey idletime $myconfig(idletime) } - # make sure country code has 4 digits, otherwise set back to 1033 (= en-US) - if { [string length [::config::getKey localecode]] != 4 } { + # make sure country code has 4 or 5 digits, otherwise set back to 1033 (= en-US) + if { [string length [::config::getKey localecode]] < 4 || [string length [::config::getKey localecode]] > 5 } { ::config::setKey localecode 1033 } Modified: trunk/amsn/protocol.tcl =================================================================== --- trunk/amsn/protocol.tcl 2008-02-28 16:26:14 UTC (rev 9612) +++ trunk/amsn/protocol.tcl 2008-02-28 17:11:06 UTC (rev 9613) @@ -5414,6 +5414,11 @@ ::config::setKey myip $d(clientip) status_log "My IP is [::config::getKey myip]\n" + + # fetch localization-code from info as long as it wasn't detected/set before + if {[::config::getKey localecode 1033] == "1033" && $d(langpreference) != ""} { + ::config::setKey localecode $d(langpreference) + } # Looks like MSN sends us whether this user has his emails enabled, so for non hotmail accounts we can automatically remove that inbox line from the CL if { [::config::getKey checkemail] == 1 && $d(email_enabled) == 0} { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |