From: <sc...@us...> - 2006-05-22 19:31:36
|
Revision: 6678 Author: scapor Date: 2006-05-22 12:31:25 -0700 (Mon, 22 May 2006) ViewCVS: http://svn.sourceforge.net/amsn/?rev=6678&view=rev Log Message: ----------- events Modified Paths: -------------- trunk/amsn/protocol.tcl Modified: trunk/amsn/protocol.tcl =================================================================== --- trunk/amsn/protocol.tcl 2006-05-22 12:48:10 UTC (rev 6677) +++ trunk/amsn/protocol.tcl 2006-05-22 19:31:25 UTC (rev 6678) @@ -1161,6 +1161,7 @@ set psm "<Data><PSM>$newpsm</PSM><CurrentMedia>$currentMedia</CurrentMedia></Data>" ::MSN::WriteSBNoNL ns "UUX" "[string length $psm]\r\n$psm" save_config +# ::Event::fireEvent myPSMChange protocol $userlogin } } else { #Do nothing @@ -1343,7 +1344,7 @@ } # An event to let the GUI know a user is copied/added to a group - ::Event::fireEvent addedUser protocol $passport $newGid + ::Event::fireEvent contactAdded protocol $passport $newGid } @@ -1371,7 +1372,7 @@ set contact [urldecode [lindex $item 4]] ;# Email address #an event to let the GUI know a user is copied/added to a group set newGid [lindex $item 6] - ::Event::fireEvent addedUser protocol $contact $newGid + ::Event::fireEvent contactAdded protocol $contact $newGid msg_box "[trans contactadded]\n$contact" } @@ -1392,7 +1393,7 @@ #an event to let the GUI know a user is copied/added to a group ::abook::setContactData $contact contactguid [string range [lindex $item 5] 2 end] ::abook::setContactForGuid [string range [lindex $item 5] 2 end] $contact - ::Event::fireEvent addedUser protocol $contact $gid + ::Event::fireEvent contactAdded protocol $contact $gid if { $gid != 0 } { moveUser $contact 0 $gid } @@ -2763,6 +2764,17 @@ variable eventsArray lappend eventsArray($eventName,$caller) $listener } + + proc unregisterEvent { eventName caller listener } { + variable eventsArray + set idx [lsearch [lindex [array get eventsArray "$eventName,$caller"] 1] $listener] + if { $idx != -1 } { + set eventsArray($eventName,$caller) [lreplace $eventsArray($eventName,$caller) $idx $idx] + } else { + status_log "ERROR: tried to unregister an unexistant event: $eventName,$caller" white + } + + } } @@ -3253,6 +3265,7 @@ } } } + ::Event::fireEvent contactPSMChange protocol $contact } method handleNOT { command payload } { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |