~amsn-daily/amsn/amsn-packaging

« back to all changes in this revision

Viewing changes to protocol.tcl

  • Committer: tjikkun
  • Date: 2008-01-10 19:24:20 UTC
  • Revision ID: svn-v4:f248a3e1-9e13-0410-b2cf-a4429de6d898:trunk/amsn:9337
start of cleaning up the msnp15 code a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
3439
3439
                global remote_auth HOME
3440
3440
 
3441
3441
                #Coming online or changing state
 
3442
                set substate [lindex $command 1]
3442
3443
                set user [lindex $command 2]
3443
 
                set evpar(user) user
 
3444
                set networkid [lindex $command 3]
3444
3445
                set user_name [urldecode [lindex $command 4]]
3445
 
                set substate [lindex $command 1]
3446
 
                set evpar(substate) substate
 
3446
                set clientid [lindex $command 5]
3447
3447
                set msnobj [urldecode [lindex $command 6]]
 
3448
 
3448
3449
                #Add clientID to abook
3449
 
                add_Clientid $user [lindex $command 5]
 
3450
                add_Clientid $user $clientid
 
3451
                set evpar(substate) substate
 
3452
                set evpar(user) user
3450
3453
 
 
3454
                set state_changed 0
3451
3455
                set oldstate [::abook::getVolatileData $user state]
3452
3456
                if { $oldstate != $substate } {
3453
3457
                        set state_changed 1
3454
 
                } else {
3455
 
                        set state_changed 0
3456
 
                }
3457
 
 
3458
 
                if { $msnobj == "" } {
3459
 
                        set msnobj -1
 
3458
                        ::abook::setVolatileData $user state $substate
 
3459
                        after 500 [list ::Event::fireEvent contactStateChange $self $user]
 
3460
                        ::plugins::PostEvent ChangeState evpar
3460
3461
                }
3461
3462
 
3462
3463
                if {$user_name == ""} {
3497
3498
 
3498
3499
                if {$state_changed } {
3499
3500
 
3500
 
                        ::plugins::PostEvent ChangeState evpar
3501
 
 
3502
 
                        #alarm system (that must replace the one that was before) - KNO
3503
 
                        set status "[trans [::MSN::stateToDescription $substate]]"
3504
 
                        if { ( [::alarms::isEnabled $user] == 1 )&& ( [::alarms::getAlarmItem $user onstatus] == 1) } {
3505
 
                                run_alarm $user $user $custom_user_name "[trans changestate $custom_user_name $status]"
3506
 
                        } elseif { ( [::alarms::isEnabled all] == 1 )&& ( [::alarms::getAlarmItem all onstatus] == 1)} {
3507
 
                                run_alarm all $user $custom_user_name "[trans changestate $custom_user_name $status]"
3508
 
                        }
3509
 
                        #end of alarm system
3510
 
 
3511
 
                        #an event used by guicontactlist to know when a contact changed state
3512
 
                        after 500 [list ::Event::fireEvent contactStateChange protocol $user]
3513
 
 
3514
3501
                        set maxw [expr {([::skin::getKey notifwidth]-53)*2} ]
3515
3502
                        set short_name [trunc $custom_user_name . $maxw splainf]
3516
3503