From: <kak...@us...> - 2011-10-11 21:11:27
|
Revision: 12344 http://amsn.svn.sourceforge.net/amsn/?rev=12344&view=rev Author: kakaroto Date: 2011-10-11 21:11:21 +0000 (Tue, 11 Oct 2011) Log Message: ----------- Fix gnotify to work with the latest protocol change of gmail's notifier API Modified Paths: -------------- trunk/amsn-extras/plugins/gnotify/gnotify.tcl trunk/amsn-extras/plugins/gnotify/plugininfo.xml Modified: trunk/amsn-extras/plugins/gnotify/gnotify.tcl =================================================================== --- trunk/amsn-extras/plugins/gnotify/gnotify.tcl 2011-09-26 08:24:36 UTC (rev 12343) +++ trunk/amsn-extras/plugins/gnotify/gnotify.tcl 2011-10-11 21:11:21 UTC (rev 12344) @@ -731,7 +731,7 @@ set headers [list Cookie $cookie] setup_http - set token [http::geturl $url -headers $headers -timeout 10000 -command [list ::gnotify::check_gmail_callback $acnt]] + set token [http::geturl $url -headers $headers -timeout 50000 -command [list ::gnotify::check_gmail_callback $acnt]] } else { set token [authenticate_gmail $acnt [list ::gnotify::check_gmail $acnt]] } @@ -756,15 +756,20 @@ switch [::http::ncode $token] { 200 { - set info_$acnt [parseGData [::http::data $token]] - - array set info [set info_$acnt] - if { $info(errors) > 0 } { + if { [catch { + set info_$acnt [parseGData [::http::data $token]] + }] } { set status_$acnt -3 cmsn_draw_online } else { - set status_$acnt 2 - cmsn_draw_online + array set info [set info_$acnt] + if { $info(errors) > 0 } { + set status_$acnt -3 + cmsn_draw_online + } else { + set status_$acnt 2 + cmsn_draw_online + } } } @@ -799,7 +804,7 @@ } } default { - plugins_log gnotify "Unknown error during check_gmail for $username : [::http::ncode $token] - $meta - [::http::data $token]" + plugins_log gnotify "Unknown error during check_gmail for $username : [::http::status $token] - [::http::ncode $token] - $meta - [::http::data $token]" set status_$acnt -3 set info_$acnt [list errors 1 mails [list]] cmsn_draw_online @@ -1103,6 +1108,8 @@ while {$data(offset) < $end } { set key [ReadKey data] + #plugins_log gnotify "Email Key is $key : [hexify_all [binary format i $key]]" + #plugins_log gnotify "offset : $data(offset) < $end" switch -- $key { 16 { # 0x10 unknown / message id? @@ -1162,6 +1169,10 @@ # 0xB8 Number of threads set info(threads) [GetMultiByte data] } + 208 { + set value [GetMultiByte data] + plugins_log gnotify "Unknown email key 0xd0 has value : $value" + } default { plugins_log gnotify "Unknown email key : $key" incr info(errors) @@ -1183,8 +1194,10 @@ set info(nb_mails) 0 set info(errors) 0 + #plugins_log gnotify "Parsing GData : \n[hexify $data_bin]\n\n[hexify_all $data_bin]" while {$data(offset) < $data(len)} { set key [ReadKey data] + #plugins_log gnotify "Key is $key : [hexify_all [binary format i $key]]" switch -- $key { 10 { # 0x0A New mail Key Modified: trunk/amsn-extras/plugins/gnotify/plugininfo.xml =================================================================== --- trunk/amsn-extras/plugins/gnotify/plugininfo.xml 2011-09-26 08:24:36 UTC (rev 12343) +++ trunk/amsn-extras/plugins/gnotify/plugininfo.xml 2011-10-11 21:11:21 UTC (rev 12344) @@ -5,12 +5,12 @@ <description>Plugin to check Gmail accounts in aMSN and notify you with the email information. A kind of "Gmail Notifer" clone for aMSN.</description> <description_hu>Ellenőrzi a Gmail fiókokat, és értesít az e-mail információkkal. A "Gmail Notifer" klónja az aMSN-hez.</description_hu> <amsn_version>0.98</amsn_version> - <plugin_version>0.92</plugin_version> + <plugin_version>0.93</plugin_version> <plugin_file>gnotify.tcl</plugin_file> <plugin_namespace>gnotify</plugin_namespace> <init_procedure>Init</init_procedure> <deinit_procedure>DeInit</deinit_procedure> - <cvs_version>11599</cvs_version> + <cvs_version>12344</cvs_version> <file> <path>pixmaps/gnotify_empty.png</path> <version>7821</version> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |