/usr/share/amsn/dock.tcl is in amsn-data 0.98.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | # Docking Protocol
::Version::setSubversionId {$Id: dock.tcl 11657 2009-10-06 23:57:03Z kakaroto $}
if { $initialize_amsn == 1 } {
global docksock
set docksock 0
}
proc dock_handler { sock } {
global password systemtray_exist
set l [gets $sock]
if { [eof $sock] || ($l == "SESSION_END") || ($l == "") } {
global docksock
fileevent $docksock readable {}
close $docksock
set docksock 0
set systemtray_exist 0
return
}
if { $l == "GO_INBOX" } {
::hotmail::hotmail_login
} elseif { $l == "GO_SIGNINAS" } {
cmsn_ns_connect [::config::getKey login] $password
} elseif { $l == "GO_SIGNIN" } {
cmsn_draw_login
} elseif { $l == "GO_OPEN" } {
if { [wm state .] == "iconic" } {
wm deiconify .
} elseif { [wm state .] == "normal" } {
wm iconify .
}
} elseif { $l == "GO_ONLINE"} {
ChCustomState NLN
} elseif { $l == "GO_NOACT" } {
ChCustomState IDL
} elseif { $l == "GO_BUSY" } {
ChCustomState BSY
} elseif { $l == "GO_BRB" } {
ChCustomState BRB
} elseif { $l == "GO_AWAY" } {
ChCustomState AWY
} elseif { $l == "GO_ONPHONE" } {
ChCustomState PHN
} elseif { $l == "GO_LUNCH" } {
ChCustomState LUN
} elseif { $l == "GO_APP_OFFLINE" } {
ChCustomState HDN
} elseif { $l == "OPEN_INBOX" } {
::hotmail::hotmail_login
} elseif { $l == "SIGNIN" } {
global password
::MSN::connect
} elseif { $l == "SIGNINAS" } {
cmsn_draw_login
} elseif { $l == "SIGNOUT" } {
::MSN::logout
} elseif { $l == "AMSN_CLOSE" } {
exit
} else {
#puts stdout "Unknown dock command"
status_log "Unknown dock command"
}
}
proc send_dock {type status} {
global docksock
if { $type == "STATUS" } {
if { $docksock != 0 } {
after 100 [list puts $docksock $status]
}
after 100 [list statusicon_proc $status]
} elseif { $type == "MAIL" } {
after 100 [list mailicon_proc $status]
}
}
proc close_dock {} {
global systemtray_exist
mailicon_proc 0
statusicon_proc "REMOVE"
global docksock
if { $docksock != 0 } {
puts $docksock "SESSION_END"
fileevent $docksock readable {}
close $docksock
set docksock 0
}
set systemtray_exist 0
}
proc accept_dock { sock addr cport } {
global docksock srvSock
if { $addr == "127.0.0.1" } {
set docksock $sock
close $srvSock
set srvSock 0
fconfigure $docksock -buffering line
puts $docksock "SESSION_HAND"
set reply [gets $docksock]
if { $reply == "SESSION_HAND" } {
puts $docksock [::MSN::myStatusIs]
fileevent $docksock readable [list dock_handler $docksock]
} else {
#puts stdout "Error During HandShake! Closing!"
status_log "Error During HandShake! Closing!"
close_dock
}
} else {
#puts stdout "Dock connection attempted from remote location, refused!"
status_log "Dock connection attempted from remote location, refused!"
}
}
proc init_dock {} {
global systemtray_exist
#If the traydock is not disabled
if { [::config::getKey use_tray] != 0} {
if {[OnWin]} {
trayicon_init
} elseif {[OnLinux] || [OnBSD] || [OnMac]} {
#We use the freedesktop standard here
if { $systemtray_exist == 0 } {
trayicon_init
if { $systemtray_exist == -1 } {
status_log "dock prob dock.tcl"
#Too bad, couldn't load the trayicon
# msg_box "[trans nosystemtray]"
}
}
statusicon_proc [::MSN::myStatusIs]
}
} else {
close_dock
}
}
proc UnixDock { } {
if {[::config::getKey use_tray] && ([OnLinux] || [OnBSD]) } {
return 1
} else {
return 0
}
}
proc WinDock { } {
if {[::config::getKey use_tray] && [OnWin] } {
return 1
} else {
return 0
}
}
proc MacDock { } {
if {[::config::getKey use_tray] && [OnMac] } {
return 1
} else {
return 0
}
}
|