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

Subscribers

People subscribed via source and target branches