/usr/share/amsn/plugins/SendRecents/sendrecents.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 | ########################################################################
# SendRecents plugin for aMSN
# Version: 1.1a (9-October-2008)
# Author: MurDoK <murdok.lnx at gmail>
# Send your feedback, bugs or wishes!
#
########################################################################
# CHANGELOG:
# - Version: 1.1a (9-October-2008) - Added lithuanian translation (thanks to Tadas Masiulionis)
# - Version: 1.1 (23-January-2008) - Added italian translation (thanks to GREGORIO)
# - Version: 1.0 (01-June-2007) - First release
#
########################################################################
# KNOWN BUGS:
# - When you send a file, menus are not updated until you close and reopen the window
#
namespace eval ::sendrecents {
proc init { dir } {
set langdir [file join $dir "lang"]
load_lang en $langdir
load_lang [::config::getGlobalKey language] $langdir
::plugins::RegisterPlugin "SendRecents"
::plugins::RegisterEvent "SendRecents" chatmenu addmenus
::plugins::RegisterEvent "SendRecents" sent_ft_invite filesend
::sendrecents::conf
}
#################
proc conf { } {
array set ::sendrecents::config {
ns {10}
}
set ::sendrecents::configlist [list \
[list str "[trans filesshowed]:" ns] \
[list ext "[trans emptyrecents]" flushlist] \
]
}
#################
proc flushlist { } {
::config::setKey recentfiles ""
}
#################
proc addmenus { event evpar } {
upvar 2 $evpar newvar
set recentsmenu $newvar(menu_name).actions.recents
menu $recentsmenu -tearoff 0 -type normal
while { [llength [::config::getKey recentfiles]] > $::sendrecents::config(ns) } {
set nu [expr $::sendrecents::config(ns) - 1]
::config::setKey recentfiles [lreplace [::config::getKey recentfiles] $nu $nu]
}
if { [llength [::config::getKey recentfiles]] == 0 } {
$recentsmenu add command -label "([trans empty])"
} else {
for {set i 0} {$i < [llength [::config::getKey recentfiles]]} {incr i} {
$recentsmenu add command -label "[file tail [lindex [::config::getKey recentfiles] $i]]" \
-command "::amsn::FileTransferSend \[::ChatWindow::getCurrentTab $newvar(window_name)\] \"[lindex [::config::getKey recentfiles] $i]\""
}
}
$newvar(menu_name).actions add separator
$newvar(menu_name).actions add cascade -label "[trans sendrecent]" -menu $recentsmenu
}
################
proc filesend { event evpar } {
upvar 2 $evpar newvar
set filename $newvar(filename)
set n [lsearch [::config::getKey recentfiles] $filename]
#already exists
if { n != -1 } {
::config::setKey recentfiles [lreplace [::config::getKey recentfiles] $n $n]
}
if { [llength [::config::getKey recentfiles]] == $::sendrecents::config(ns) } {
set nu [expr $::sendrecents::config(ns) - 1]
::config::setKey recentfiles [lreplace [::config::getKey recentfiles] $nu $nu]
}
::config::setKey recentfiles [linsert [::config::getKey recentfiles] 0 $filename]
}
}
################################################################################################
|