~ubuntu-branches/ubuntu/saucy/amsn/saucy

« back to all changes in this revision

Viewing changes to plugins/camserv/camserv.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2010-04-13 23:21:29 UTC
  • mfrom: (1.1.11 upstream) (3.1.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100413232129-vgpx20brdd2qavs7
Tags: 0.98.3-0ubuntu1
* Merge from Debian unstable (LP: #449072), remaining Ubuntu changes:
  - add 08_use_aplay_for_sound.dpatch patch by Festor Wailon Dacoba to use
    aplay to play sounds
  + debian/control:
    - modify iceweasel to firefox | abrowser in amsn Suggests field
    - add xdg-utils and gstreamer0.10-nice to amsn Depends field
    - mofify sox to alsa-utils in amsn Suggests field as we are now using
      aplay
* New upstream release (LP: #562619), tarball repacked according to
  debian/README.source.
* Fix missing-debian-source-format lintian warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
namespace eval ::camserv {
 
2
        variable plugin_name "Webcam Server"
 
3
        variable config
 
4
        variable configlist
 
5
        
 
6
        
 
7
        proc Init { dir } {
 
8
                variable plugin_name 
 
9
                variable config
 
10
                variable configlist
 
11
 
 
12
                ::plugins::RegisterPlugin $plugin_name
 
13
                ::plugins::RegisterEvent $plugin_name chat_msg_receive msgReceive
 
14
                
 
15
                array set config {
 
16
                        contacts {my_allowed_contact@hotmail.com}                       
 
17
                        magicword {sendcamtome}
 
18
                }
 
19
                
 
20
 
 
21
                set configlist [list \
 
22
                        [list str "Magic word"  magicword] \
 
23
                        [list str "Contacts"  contacts] \
 
24
                ]
 
25
        }
 
26
        
 
27
        proc msgReceive {event evpar} {
 
28
                variable config
 
29
 
 
30
                upvar 2 msg msg
 
31
                upvar 2 user user
 
32
                set email $user         
 
33
 
 
34
#TODO: first check should be if it is part of the string
 
35
                if { $config(contacts) == $email && $email != [::config::getKey login]} {
 
36
#TODO: check if it's the first word of the msg instead of is the msg
 
37
                        if { $msg == $config(magicword)} {
 
38
                                ::MSNCAM::SendInviteQueue $email
 
39
                        }
 
40
 
 
41
#TODO: a change magicword command (syntax: "change oldword newword" ?
 
42
#                       if {[string first "magicword" $msg] == 0 )} {
 
43
#                               set msg [string range $msg 10 end]
 
44
#                               
 
45
#
 
46
#                       }
 
47
 
 
48
 
 
49
 
 
50
                }
 
51
        }
 
52
 
 
53
 
 
54
}