From: <lep...@us...> - 2007-05-27 01:11:23
|
Revision: 8771 http://svn.sourceforge.net/amsn/?rev=8771&view=rev Author: lephilousophe Date: 2007-05-26 18:11:23 -0700 (Sat, 26 May 2007) Log Message: ----------- Fixes a bug that could occur when receiving 1 OIM Fixes a bug that occured when OIM were sent from Yahoo user : parsing of email address is improved Thanks to MysticalOS for the debug Thanks to KKRT for the regexp : at 3h00AM I am not really good for such things... Modified Paths: -------------- trunk/amsn/hotmail.tcl trunk/amsn/protocol.tcl Modified: trunk/amsn/hotmail.tcl =================================================================== --- trunk/amsn/hotmail.tcl 2007-05-27 00:50:12 UTC (rev 8770) +++ trunk/amsn/hotmail.tcl 2007-05-27 01:11:23 UTC (rev 8771) @@ -177,7 +177,6 @@ if { $oim_message == "" } { break } - incr oim_count set from [GetXmlEntry $mailList ":MD:M:E" $oim_count] set nick [GetXmlEntry $mailList ":MD:M:N" $oim_count] @@ -189,9 +188,10 @@ } set oim [list $from $nick $oim_message] lappend oim_messages $oim + incr oim_count } if { $oim_count > 0 } { - after 0 "::hotmail::askReadReceivedOIMs $oim_count [list $oim_messages]" + after 0 [list ::hotmail::askReadReceivedOIMs $oim_count $oim_messages] } } else { status_log "Mail-Data is invalid : $mailData" Modified: trunk/amsn/protocol.tcl =================================================================== --- trunk/amsn/protocol.tcl 2007-05-27 00:50:12 UTC (rev 8770) +++ trunk/amsn/protocol.tcl 2007-05-27 01:11:23 UTC (rev 8771) @@ -2920,12 +2920,13 @@ set ctype [$msg getHeader Content-type] set cencoding [$msg getHeader Content-Transfer-Encoding] set arrivalTime [$msg getHeader X-OriginalArrivalTime] - set parts [split $from " "] - set nick [lindex $parts 0] - set email [lindex $parts 1] - if {$email != "" } { - set email [string trim $email " <>"] + if { ![regexp {([^\<]*)\s?\<([^\>]+)\>} $from -> nick email] } { + set email $from + set nick $from + } elseif { $nick == ""} { + set nick $email } + set email [string trim $email " <>"] set nick [parseFieldEncoding $nick] if { $cencoding == "base64" } { set body [encoding convertfrom identity [string map {"\r\n" "\n"} [base64::decode [string trim $body]]]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |