Merge lp:~stefanor/ibid/nickserv-340728 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Superseded
Proposed branch: lp:~stefanor/ibid/nickserv-340728
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~stefanor/ibid/nickserv-340728
Reviewer Review Type Date Requested Status
Ibid Core Team Pending
Review via email: mp+8264@code.launchpad.net

This proposal has been superseded by a proposal from 2009-07-07.

To post a comment you must log in.
Revision history for this message
Stefano Rivera (stefanor) wrote :

Thoughts?

Revision history for this message
Stefano Rivera (stefanor) wrote :

> Thoughts?

My thoughts:
* This should be included in the default config. Commented out?
* I'm not mad about nickserv_connection.

Revision history for this message
Jonathan Hitchcock (vhata) wrote :

> Thoughts?

I'm not keen on the hardcoding of "NickServ" either - that should be configurable...

lp:~stefanor/ibid/nickserv-340728 updated
695. By Stefano Rivera

Don't override process()

696. By Stefano Rivera

Use mask rather than absolute match

697. By Stefano Rivera

Configurable NickServ Name

698. By Stefano Rivera

Another regex that should now be supported

699. By Stefano Rivera

Ensure IRC source

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid.ini'
2--- ibid.ini 2009-05-31 08:10:44 +0000
3+++ ibid.ini 2009-07-06 14:13:24 +0000
4@@ -55,7 +55,7 @@
5 object_path = /org/ibid/module/Ping
6 [[core]]
7 names = $botname, bot, ant
8- ignore = NickServ,
9+ ignore = ,
10 [[bzr]]
11 source = atrum
12 channel = "#ibid"
13
14=== modified file 'ibid/config.ini'
15--- ibid/config.ini 2009-04-17 23:49:41 +0000
16+++ ibid/config.ini 2009-07-06 14:13:24 +0000
17@@ -17,7 +17,7 @@
18 cachedir = /tmp/ibid
19 [[core]]
20 names = $botname, bot, ant
21- ignore = NickServ,
22+ ignore = ,
23
24 [databases]
25 ibid = sqlite:///ibid.db
26
27=== modified file 'ibid/plugins/irc.py'
28--- ibid/plugins/irc.py 2009-03-16 20:55:20 +0000
29+++ ibid/plugins/irc.py 2009-07-06 14:35:07 +0000
30@@ -1,7 +1,11 @@
31 """Administrative commands for IRC"""
32
33+import logging
34+
35 import ibid
36-from ibid.plugins import Processor, match, authorise
37+from ibid.plugins import Processor, match, handler, authorise
38+
39+log = logging.getLogger('plugins.irc')
40
41 help = {"irc": u"Provides commands for joining/parting channels on IRC and Jabber, and changing the bot's nick"}
42
43@@ -60,4 +64,32 @@
44 source.change_nick(nick)
45 event.addresponse(u'Changing nick to %s', nick)
46
47+class NickServ(Processor):
48+ event_types = ('notice',)
49+
50+ def process(self, event):
51+ if event.sender.get('nick') != u'NickServ':
52+ return
53+
54+ source_cfg = ibid.config['sources'][event.source]
55+
56+ if u'nickserv_connection' in source_cfg and \
57+ source_cfg[u'nickserv_connection'] != event.sender['connection']:
58+ return
59+
60+ Processor.process(self, event)
61+
62+ @match(r'^(?:This nickname is registered\. Please choose a different nickname'
63+ r'|This nickname is registered and protected\. If it is your)')
64+ def auth(self, event):
65+ source_cfg = ibid.config['sources'][event.source]
66+
67+ if u'nickserv_password' in source_cfg:
68+ event.addresponse(u'IDENTIFY %s', source_cfg[u'nickserv_password'])
69+
70+ @match(r'^(?:You are now identified for'
71+ r'|Password accepted -+ you are now recognized)')
72+ def success(self, event):
73+ log.info(u'Authenticated with NickServ')
74+
75 # vi: set et sta sw=4 ts=4:
76
77=== modified file 'ibid/plugins/log.py'
78--- ibid/plugins/log.py 2009-07-04 23:45:41 +0000
79+++ ibid/plugins/log.py 2009-07-06 14:16:40 +0000
80@@ -20,6 +20,8 @@
81 u'%(year)d/%(month)02d/%(day)02d %(hour)02d:%(minute)02d:%(second)02d <%(sender_nick)s> %(message)s')
82 action_format = Option('action_format', 'Format string for actions',
83 u'%(year)d/%(month)02d/%(day)02d %(hour)02d:%(minute)02d:%(second)02d * %(sender_nick)s %(message)s')
84+ notice_format = Option('notice_format', 'Format string for notices',
85+ u'%(year)d/%(month)02d/%(day)02d %(hour)02d:%(minute)02d:%(second)02d -%(sender_nick)s- %(message)s')
86 presence_format = Option('presence_format', 'Format string for presence events',
87 u'%(year)d/%(month)02d/%(day)02d %(hour)02d:%(minute)02d:%(second)02d %(sender_nick)s (%(sender_connection)s) is now %(state)s')
88 logs = {}
89@@ -50,13 +52,14 @@
90 return self.logs[filename][0]
91
92 def log_event(self, event):
93- if event.type in ('message', 'state', 'action'):
94+ if event.type in ('message', 'state', 'action', 'notice'):
95 when = localtime(event.time)
96
97 format = {
98 'message': self.message_format,
99 'state': self.presence_format,
100 'action': self.action_format,
101+ 'notice': self.notice_format,
102 }[event.type]
103
104 fields = {

Subscribers

People subscribed via source and target branches