This file is indexed.

/usr/lib/python2.7/dist-packages/gplugs/autovoice.py is in gozerbot 0.99.1-5.

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
# plugins/autovoice.py
#
#

""" do voice on join """

__copyright__ = 'this file is in the public domain'

from gozerbot.commands import cmnds
from gozerbot.callbacks import callbacks
from gozerbot.examples import examples
from gozerbot.plughelp import plughelp
from gozerbot.tests import tests

plughelp.add('autovoice', 'enable auto voicing of people join .. commands \
work for the channels the commands are given in')

def preautovoice(bot, ievent):
    """ precondition on auto-op .. we must be op """
    if ievent.channel in bot.state['opchan']:
        return 1

def cbautovoice(bot, ievent):
    """ autovoice callback """
    chandata = 0
    try:
        chandata = bot.channels[ievent.channel]['autovoice']
    except KeyError:
        return
    if chandata:
        bot.voice(ievent.channel, ievent.nick)

callbacks.add('JOIN', cbautovoice, preautovoice)

def handle_autovoiceon(bot, ievent):
    """ autovoice-on .. enable autovoice for channel the command was given \
        in """
    try:
        bot.channels[ievent.channel]['autovoice'] = 1
    except TypeError:
        ievent.reply('no %s in channel database' % ievent.channel)
        return
    ievent.reply('autovoice enabled on %s' % ievent.channel)

cmnds.add('autovoice-on', handle_autovoiceon, 'OPER')
examples.add('autovoice-on', 'enable autovoice on channel in which the \
command is given', 'autovoice-on')

def handle_autovoiceoff(bot, ievent):
    """ autovoice-off .. disable autovoice for the channel the command was \
        given in """
    try:
        bot.channels[ievent.channel]['autovoice'] = 0
        ievent.reply('autovoice disabled on %s' % ievent.channel)
    except TypeError:
        ievent.reply('no %s channel in database' % ievent.channel)

cmnds.add('autovoice-off', handle_autovoiceoff, 'OPER')
examples.add('autovoice-off', 'disable autovoice on channel in which \
the command is given', 'autovoice-off')
tests.add('autovoice-on --chan #dunkbots', 'enabled').fakein(':dunker!mekker@127.0.0.1 JOIN #dunkbots').add('autovoice-off --chan #dunkbots', 'disabled')