Merge lp:~stefanor/ibid/dc-too-long-503017 into lp:~ibid-core/ibid/old-trunk-1.6
- dc-too-long-503017
- Merge into old-trunk-1.6
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Jonathan Hitchcock | ||||||||
Approved revision: | not available | ||||||||
Merged at revision: | 834 | ||||||||
Proposed branch: | lp:~stefanor/ibid/dc-too-long-503017 | ||||||||
Merge into: | lp:~ibid-core/ibid/old-trunk-1.6 | ||||||||
Diff against target: |
331 lines (+124/-17) 10 files modified
ibid/core.py (+2/-0) ibid/plugins/core.py (+54/-8) ibid/source/__init__.py (+21/-0) ibid/source/campfire.py (+3/-0) ibid/source/dc.py (+15/-2) ibid/source/http.py (+4/-4) ibid/source/irc.py (+3/-0) ibid/source/jabber.py (+7/-0) ibid/source/silc.py (+9/-2) scripts/ibid-plugin (+6/-1) |
||||||||
To merge this branch: | bzr merge lp:~stefanor/ibid/dc-too-long-503017 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Hitchcock | Approve | ||
Michael Gorven | Approve | ||
Review via email: mp+16821@code.launchpad.net |
This proposal supersedes a proposal from 2010-01-04.
Commit message
Description of the change
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
Stefano Rivera (stefanor) wrote : Posted in a previous version of this proposal | # |
Urgent merge, but probably a little controversial
Jonathan Hitchcock (vhata) wrote : Posted in a previous version of this proposal | # |
Hardcoded line-lengths bad.
Stefano Rivera (stefanor) wrote : | # |
Now available without hardcoded line-lengths
Michael Gorven (mgorven) wrote : | # |
Looks fine.
review approve
- 832. By Stefano Rivera
-
horizontal ellipsis = 3 utf-8 bytes
Jonathan Hitchcock (vhata) wrote : | # |
Not sure I like max_message_length vs message_max_length - which is which? And why does silc suddenly grow one that refers to public length? And why does jabber not have a similar one to silc, since they both only limit in public?
Also unhappy about sources modifying some of their settings based on other settings - e.g. removing 'action' from supports if there is no action_prefix set. If a source author says that his source supports actions, then believe him, even if he forget to set an action_prefix (make one up yourself?).
- 833. By Stefano Rivera
-
Add setup() method to sources and docstrings to IbidSourceFactory
- 834. By Stefano Rivera
-
Use the new source setup method
- 835. By Stefano Rivera
-
Whitespace
Stefano Rivera (stefanor) wrote : | # |
> If a source author says that his source supports actions, then believe him,
> even if he forget to set an action_prefix (make one up yourself?).
Um, if only DC were that simple... Got it?
- 836. By Stefano Rivera
-
Whoops, ibid.sources is a list of names not sources
Jonathan Hitchcock (vhata) wrote : | # |
I still don't like this:
def setup(self):
if self.action_prefix is None and 'action' in self.supports:
self.
if self.action_prefix is not None and 'action' not in self.supports:
self.
Your explanation:
12:49 <tumbleweed> Vhata: the DC protocol don't actually support actions
12:49 <tumbleweed> some severs support public actions with "/me says foo"
12:49 <tumbleweed> some use the syntax "+me says foo"
However, I think you're doing it the wrong way round. I feel that "supports" is more authoritative than setting an option. So, rather:
if self.action_prefix is None and 'action' in self.supports:
self.
if self.action_prefix is not None and 'action' not in self.supports:
pass # who cares? they can set the option if they want. Ignore it.
See also my comments about the inconsistency between the jabber and silc private/public max_message_length, and the confusing names...
- 837. By Stefano Rivera
-
Don't have action in the supports list by default
Jonathan Hitchcock (vhata) wrote : | # |
Right, Stefano's explained the weird shit that DC does.
I retract that stuff...
- 838. By Stefano Rivera
-
Rename function that was very similar (in name) to a related variable
Jonathan Hitchcock (vhata) wrote : | # |
*phew*
approve.
Preview Diff
1 | === modified file 'ibid/core.py' | |||
2 | --- ibid/core.py 2010-01-04 22:04:04 +0000 | |||
3 | +++ ibid/core.py 2010-01-07 12:26:15 +0000 | |||
4 | @@ -273,6 +273,8 @@ | |||
5 | 273 | def reload_config(self): | 273 | def reload_config(self): |
6 | 274 | for processor in ibid.processors: | 274 | for processor in ibid.processors: |
7 | 275 | processor.setup() | 275 | processor.setup() |
8 | 276 | for source in ibid.sources: | ||
9 | 277 | ibid.sources[source].setup() | ||
10 | 276 | self.log.info(u"Notified all processors of config reload") | 278 | self.log.info(u"Notified all processors of config reload") |
11 | 277 | 279 | ||
12 | 278 | def regexp(pattern, item): | 280 | def regexp(pattern, item): |
13 | 279 | 281 | ||
14 | === modified file 'ibid/plugins/core.py' | |||
15 | --- ibid/plugins/core.py 2010-01-02 17:03:20 +0000 | |||
16 | +++ ibid/plugins/core.py 2010-01-07 12:26:15 +0000 | |||
17 | @@ -172,28 +172,74 @@ | |||
18 | 172 | class Format(Processor): | 172 | class Format(Processor): |
19 | 173 | priority = 2000 | 173 | priority = 2000 |
20 | 174 | 174 | ||
21 | 175 | def _truncate(self, line, length): | ||
22 | 176 | if length is not None: | ||
23 | 177 | eline = line.encode('utf-8') | ||
24 | 178 | if len(eline) > length: | ||
25 | 179 | # horizontal ellipsis = 3 utf-8 bytes | ||
26 | 180 | return eline[:length-3].decode('utf-8', 'ignore') \ | ||
27 | 181 | + u'\N{horizontal ellipsis}' | ||
28 | 182 | return line | ||
29 | 183 | |||
30 | 175 | def process(self, event): | 184 | def process(self, event): |
31 | 176 | filtered = [] | 185 | filtered = [] |
32 | 177 | for response in event.responses: | 186 | for response in event.responses: |
33 | 178 | source = response['source'].lower() | 187 | source = response['source'].lower() |
34 | 179 | supports = ibid.sources[source].supports | 188 | supports = ibid.sources[source].supports |
35 | 189 | maxlen = ibid.sources[source].truncation_point(response, event) | ||
36 | 180 | 190 | ||
37 | 181 | if response.get('action', False) and 'action' not in supports: | 191 | if response.get('action', False) and 'action' not in supports: |
38 | 182 | response['reply'] = u'*%s*' % response['reply'] | 192 | response['reply'] = u'*%s*' % response['reply'] |
39 | 183 | 193 | ||
40 | 184 | conflate = response.get('conflate', True) | 194 | conflate = response.get('conflate', True) |
41 | 195 | # Expand response into multiple single-line responses: | ||
42 | 185 | if (not conflate and 'multiline' not in supports): | 196 | if (not conflate and 'multiline' not in supports): |
43 | 186 | for line in response['reply'].split('\n'): | 197 | for line in response['reply'].split('\n'): |
49 | 187 | r = {'reply': line} | 198 | r = {'reply': self._truncate(line, maxlen)} |
50 | 188 | for k in response.iterkeys(): | 199 | for k in response.iterkeys(): |
51 | 189 | if k not in ('reply'): | 200 | if k not in ('reply'): |
52 | 190 | r[k] = response[k] | 201 | r[k] = response[k] |
53 | 191 | filtered.append(r) | 202 | filtered.append(r) |
54 | 203 | |||
55 | 204 | # Expand response into multiple multi-line responses: | ||
56 | 205 | elif (not conflate and 'multiline' in supports | ||
57 | 206 | and maxlen is not None): | ||
58 | 207 | message = response['reply'] | ||
59 | 208 | while len(message.encode('utf-8')) > maxlen: | ||
60 | 209 | splitpoint = len(message.encode('utf-8')[:maxlen] \ | ||
61 | 210 | .decode('utf-8', 'ignore')) | ||
62 | 211 | parts = [message[:splitpoint].rstrip(), | ||
63 | 212 | message[splitpoint:].lstrip()] | ||
64 | 213 | for sep in u'\n.;:, ': | ||
65 | 214 | if sep in u'\n ': | ||
66 | 215 | search = message[:splitpoint+1] | ||
67 | 216 | else: | ||
68 | 217 | search = message[:splitpoint] | ||
69 | 218 | if sep in search: | ||
70 | 219 | splitpoint = search.rindex(sep) | ||
71 | 220 | parts = [message[:splitpoint+1].rstrip(), | ||
72 | 221 | message[splitpoint+1:]] | ||
73 | 222 | break | ||
74 | 223 | r = {'reply': parts[0]} | ||
75 | 224 | for k in response.iterkeys(): | ||
76 | 225 | if k not in ('reply'): | ||
77 | 226 | r[k] = response[k] | ||
78 | 227 | filtered.append(r) | ||
79 | 228 | message = parts[1] | ||
80 | 229 | |||
81 | 230 | response['reply'] = message | ||
82 | 231 | filtered.append(response) | ||
83 | 232 | |||
84 | 192 | else: | 233 | else: |
85 | 234 | line = response['reply'] | ||
86 | 235 | # Remove any characters that make no sense on IRC-like sources: | ||
87 | 193 | if 'multiline' not in supports: | 236 | if 'multiline' not in supports: |
91 | 194 | response['reply'] = response['reply'].expandtabs(1) \ | 237 | line = line.expandtabs(1) \ |
92 | 195 | .replace('\n', conflate == True | 238 | .replace('\n', conflate == True |
93 | 196 | and u' ' or conflate or u'') | 239 | and u' ' or conflate or u'') |
94 | 240 | |||
95 | 241 | response['reply'] = self._truncate(line, maxlen) | ||
96 | 242 | |||
97 | 197 | filtered.append(response) | 243 | filtered.append(response) |
98 | 198 | 244 | ||
99 | 199 | event.responses = filtered | 245 | event.responses = filtered |
100 | 200 | 246 | ||
101 | === modified file 'ibid/source/__init__.py' | |||
102 | --- ibid/source/__init__.py 2009-07-22 21:11:01 +0000 | |||
103 | +++ ibid/source/__init__.py 2010-01-07 12:26:15 +0000 | |||
104 | @@ -19,23 +19,44 @@ | |||
105 | 19 | 19 | ||
106 | 20 | def __init__(self, name): | 20 | def __init__(self, name): |
107 | 21 | self.name = name | 21 | self.name = name |
108 | 22 | self.setup() | ||
109 | 23 | |||
110 | 24 | def setup(self): | ||
111 | 25 | "Apply configuration. Called on every config reload" | ||
112 | 26 | pass | ||
113 | 22 | 27 | ||
114 | 23 | def setServiceParent(self, service): | 28 | def setServiceParent(self, service): |
115 | 29 | "Start the source and connect" | ||
116 | 24 | raise NotImplementedError | 30 | raise NotImplementedError |
117 | 25 | 31 | ||
118 | 26 | def connect(self): | 32 | def connect(self): |
119 | 33 | "Connect (if disconncted)" | ||
120 | 27 | return self.setServiceParent(None) | 34 | return self.setServiceParent(None) |
121 | 28 | 35 | ||
122 | 29 | def disconnect(self): | 36 | def disconnect(self): |
123 | 37 | "Disconnect source" | ||
124 | 30 | raise NotImplementedError | 38 | raise NotImplementedError |
125 | 31 | 39 | ||
126 | 32 | def url(self): | 40 | def url(self): |
127 | 41 | "Return a URL describing the source" | ||
128 | 33 | return None | 42 | return None |
129 | 34 | 43 | ||
130 | 35 | def logging_name(self, identity): | 44 | def logging_name(self, identity): |
131 | 36 | "Given an identity or connection, return a name suitable for logging" | 45 | "Given an identity or connection, return a name suitable for logging" |
132 | 37 | return identity | 46 | return identity |
133 | 38 | 47 | ||
134 | 48 | def truncation_point(self, response, event=None): | ||
135 | 49 | """Given a target, and possibly a related event, return the number of | ||
136 | 50 | bytes to clip at, or None to indicate that a complete message will | ||
137 | 51 | be delivered. | ||
138 | 52 | """ | ||
139 | 53 | if (event is not None | ||
140 | 54 | and response.get('target', None) == event.get('channel', None) | ||
141 | 55 | and event.get('public', True)): | ||
142 | 56 | return 490 | ||
143 | 57 | |||
144 | 58 | return None | ||
145 | 59 | |||
146 | 39 | from ibid.config import Option | 60 | from ibid.config import Option |
147 | 40 | 61 | ||
148 | 41 | options = { | 62 | options = { |
149 | 42 | 63 | ||
150 | === modified file 'ibid/source/campfire.py' | |||
151 | --- ibid/source/campfire.py 2009-12-30 22:18:47 +0000 | |||
152 | +++ ibid/source/campfire.py 2010-01-07 12:26:15 +0000 | |||
153 | @@ -125,4 +125,7 @@ | |||
154 | 125 | def leave(self, room_name): | 125 | def leave(self, room_name): |
155 | 126 | return self.client.leave(room_name) | 126 | return self.client.leave(room_name) |
156 | 127 | 127 | ||
157 | 128 | def truncation_point(self, response, event=None): | ||
158 | 129 | return None | ||
159 | 130 | |||
160 | 128 | # vi: set et sta sw=4 ts=4: | 131 | # vi: set et sta sw=4 ts=4: |
161 | 129 | 132 | ||
162 | === modified file 'ibid/source/dc.py' | |||
163 | --- ibid/source/dc.py 2009-12-30 22:18:47 +0000 | |||
164 | +++ ibid/source/dc.py 2010-01-07 12:26:15 +0000 | |||
165 | @@ -129,8 +129,10 @@ | |||
166 | 129 | elif response.get('action', False): | 129 | elif response.get('action', False): |
167 | 130 | if self.factory.action_prefix and target is None: | 130 | if self.factory.action_prefix and target is None: |
168 | 131 | self.say(target, u'%s %s' % (self.factory.action_prefix, message)) | 131 | self.say(target, u'%s %s' % (self.factory.action_prefix, message)) |
169 | 132 | elif self.factory.action_prefix: | ||
170 | 133 | self.say(target, u'*%s*' % message) | ||
171 | 132 | else: | 134 | else: |
173 | 133 | self.say(target, u'* %s %s' % (self.my_nickname, message)) | 135 | self.say(target, message) |
174 | 134 | 136 | ||
175 | 135 | self.factory.log.debug(u"Sent action to %s: %s", target, message) | 137 | self.factory.log.debug(u"Sent action to %s: %s", target, message) |
176 | 136 | else: | 138 | else: |
177 | @@ -156,7 +158,7 @@ | |||
178 | 156 | class SourceFactory(protocol.ReconnectingClientFactory, IbidSourceFactory): | 158 | class SourceFactory(protocol.ReconnectingClientFactory, IbidSourceFactory): |
179 | 157 | protocol = DCBot | 159 | protocol = DCBot |
180 | 158 | 160 | ||
182 | 159 | supports = ('action', 'multiline', 'topic') | 161 | supports = ['multiline', 'topic'] |
183 | 160 | auth = ('op',) | 162 | auth = ('op',) |
184 | 161 | 163 | ||
185 | 162 | port = IntOption('port', 'Server port number', 411) | 164 | port = IntOption('port', 'Server port number', 411) |
186 | @@ -170,6 +172,8 @@ | |||
187 | 170 | slots = IntOption('slots', 'DC Open Slots', 0) | 172 | slots = IntOption('slots', 'DC Open Slots', 0) |
188 | 171 | action_prefix = Option('action_prefix', 'Command for actions (i.e. +me)', None) | 173 | action_prefix = Option('action_prefix', 'Command for actions (i.e. +me)', None) |
189 | 172 | banned_prefixes = Option('banned_prefixes', 'Prefixes not allowed in bot responses, i.e. !', '') | 174 | banned_prefixes = Option('banned_prefixes', 'Prefixes not allowed in bot responses, i.e. !', '') |
190 | 175 | max_message_length = IntOption('max_message_length', | ||
191 | 176 | 'Maximum length of messages', 490) | ||
192 | 173 | ping_interval = FloatOption('ping_interval', 'Seconds idle before sending a PING', 60) | 177 | ping_interval = FloatOption('ping_interval', 'Seconds idle before sending a PING', 60) |
193 | 174 | pong_timeout = FloatOption('pong_timeout', 'Seconds to wait for PONG', 300) | 178 | pong_timeout = FloatOption('pong_timeout', 'Seconds to wait for PONG', 300) |
194 | 175 | # ReconnectingClient uses this: | 179 | # ReconnectingClient uses this: |
195 | @@ -181,6 +185,12 @@ | |||
196 | 181 | self.log = logging.getLogger('source.%s' % self.name) | 185 | self.log = logging.getLogger('source.%s' % self.name) |
197 | 182 | self._auth = {} | 186 | self._auth = {} |
198 | 183 | 187 | ||
199 | 188 | def setup(self): | ||
200 | 189 | if self.action_prefix is None and 'action' in self.supports: | ||
201 | 190 | self.supports.remove('action') | ||
202 | 191 | if self.action_prefix is not None and 'action' not in self.supports: | ||
203 | 192 | self.supports.append('action') | ||
204 | 193 | |||
205 | 184 | def setServiceParent(self, service): | 194 | def setServiceParent(self, service): |
206 | 185 | if service: | 195 | if service: |
207 | 186 | internet.TCPClient(self.server, self.port, self).setServiceParent(service) | 196 | internet.TCPClient(self.server, self.port, self).setServiceParent(service) |
208 | @@ -197,6 +207,9 @@ | |||
209 | 197 | self.proto.transport.loseConnection() | 207 | self.proto.transport.loseConnection() |
210 | 198 | return True | 208 | return True |
211 | 199 | 209 | ||
212 | 210 | def truncation_point(self, response, event=None): | ||
213 | 211 | return self.max_message_length | ||
214 | 212 | |||
215 | 200 | def _dc_auth_callback(self, nick, result): | 213 | def _dc_auth_callback(self, nick, result): |
216 | 201 | self._auth[nick] = result | 214 | self._auth[nick] = result |
217 | 202 | 215 | ||
218 | 203 | 216 | ||
219 | === modified file 'ibid/source/http.py' | |||
220 | --- ibid/source/http.py 2010-01-06 07:56:27 +0000 | |||
221 | +++ ibid/source/http.py 2010-01-07 12:26:15 +0000 | |||
222 | @@ -104,10 +104,10 @@ | |||
223 | 104 | self.site = server.Site(root) | 104 | self.site = server.Site(root) |
224 | 105 | 105 | ||
225 | 106 | def setServiceParent(self, service): | 106 | def setServiceParent(self, service): |
230 | 107 | if service: | 107 | if service: |
231 | 108 | return internet.TCPServer(self.port, self.site).setServiceParent(service) | 108 | return internet.TCPServer(self.port, self.site).setServiceParent(service) |
232 | 109 | else: | 109 | else: |
233 | 110 | reactor.listenTCP(self.port, self.site) | 110 | reactor.listenTCP(self.port, self.site) |
234 | 111 | 111 | ||
235 | 112 | def url(self): | 112 | def url(self): |
236 | 113 | return self.myurl | 113 | return self.myurl |
237 | 114 | 114 | ||
238 | === modified file 'ibid/source/irc.py' | |||
239 | --- ibid/source/irc.py 2010-01-02 12:17:07 +0000 | |||
240 | +++ ibid/source/irc.py 2010-01-07 12:26:15 +0000 | |||
241 | @@ -323,6 +323,9 @@ | |||
242 | 323 | return u'' | 323 | return u'' |
243 | 324 | return identity.split(u'!')[0] | 324 | return identity.split(u'!')[0] |
244 | 325 | 325 | ||
245 | 326 | def truncation_point(self, response, event=None): | ||
246 | 327 | return 490 | ||
247 | 328 | |||
248 | 326 | def url(self): | 329 | def url(self): |
249 | 327 | return u'irc://%s@%s:%s' % (self.nick, self.server, self.port) | 330 | return u'irc://%s@%s:%s' % (self.nick, self.server, self.port) |
250 | 328 | 331 | ||
251 | 329 | 332 | ||
252 | === modified file 'ibid/source/jabber.py' | |||
253 | --- ibid/source/jabber.py 2009-12-30 22:18:47 +0000 | |||
254 | +++ ibid/source/jabber.py 2010-01-07 12:26:15 +0000 | |||
255 | @@ -168,6 +168,8 @@ | |||
256 | 168 | nick = Option('nick', 'Nick for chatrooms', ibid.config['botname']) | 168 | nick = Option('nick', 'Nick for chatrooms', ibid.config['botname']) |
257 | 169 | rooms = ListOption('rooms', 'Chatrooms to autojoin', []) | 169 | rooms = ListOption('rooms', 'Chatrooms to autojoin', []) |
258 | 170 | accept_domains = Option('accept_domains', 'Only accept messages from these domains') | 170 | accept_domains = Option('accept_domains', 'Only accept messages from these domains') |
259 | 171 | max_public_message_length = IntOption('max_public_message_length', | ||
260 | 172 | 'Maximum length of public messages', 512) | ||
261 | 171 | 173 | ||
262 | 172 | def __init__(self, name): | 174 | def __init__(self, name): |
263 | 173 | IbidSourceFactory.__init__(self, name) | 175 | IbidSourceFactory.__init__(self, name) |
264 | @@ -212,4 +214,9 @@ | |||
265 | 212 | def logging_name(self, identity): | 214 | def logging_name(self, identity): |
266 | 213 | return identity.split('/')[0] | 215 | return identity.split('/')[0] |
267 | 214 | 216 | ||
268 | 217 | def truncation_point(self, response, event=None): | ||
269 | 218 | if response.get('target', None) in self.proto.rooms: | ||
270 | 219 | return self.max_public_message_length | ||
271 | 220 | return None | ||
272 | 221 | |||
273 | 215 | # vi: set et sta sw=4 ts=4: | 222 | # vi: set et sta sw=4 ts=4: |
274 | 216 | 223 | ||
275 | === modified file 'ibid/source/silc.py' | |||
276 | --- ibid/source/silc.py 2010-01-02 12:17:07 +0000 | |||
277 | +++ ibid/source/silc.py 2010-01-07 12:26:15 +0000 | |||
278 | @@ -69,7 +69,7 @@ | |||
279 | 69 | self.send(response) | 69 | self.send(response) |
280 | 70 | 70 | ||
281 | 71 | def send(self, response): | 71 | def send(self, response): |
283 | 72 | message = response['reply'].encode('utf-8') | 72 | message = response['reply'] |
284 | 73 | flags=0 | 73 | flags=0 |
285 | 74 | if response.get('action', False): | 74 | if response.get('action', False): |
286 | 75 | flags=4 | 75 | flags=4 |
287 | @@ -186,7 +186,7 @@ | |||
288 | 186 | self.command_call('QUIT') | 186 | self.command_call('QUIT') |
289 | 187 | 187 | ||
290 | 188 | def disconnected(self, message): | 188 | def disconnected(self, message): |
292 | 189 | self.factory.log.info(u"Disconnected (%s)", reason) | 189 | self.factory.log.info(u"Disconnected (%s)", message) |
293 | 190 | 190 | ||
294 | 191 | event = Event(self.factory.name, u'source') | 191 | event = Event(self.factory.name, u'source') |
295 | 192 | event.status = u'disconnected' | 192 | event.status = u'disconnected' |
296 | @@ -208,6 +208,8 @@ | |||
297 | 208 | realname = Option('realname', 'Real Name', ibid.config['botname']) | 208 | realname = Option('realname', 'Real Name', ibid.config['botname']) |
298 | 209 | public_key = Option('public_key', 'Filename of public key', 'silc.pub') | 209 | public_key = Option('public_key', 'Filename of public key', 'silc.pub') |
299 | 210 | private_key = Option('private_key', 'Filename of private key', 'silc.prv') | 210 | private_key = Option('private_key', 'Filename of private key', 'silc.prv') |
300 | 211 | max_public_message_length = IntOption('max_public_message_length', | ||
301 | 212 | 'Maximum length of public messages', 512) | ||
302 | 211 | 213 | ||
303 | 212 | def __init__(self, name): | 214 | def __init__(self, name): |
304 | 213 | IbidSourceFactory.__init__(self, name) | 215 | IbidSourceFactory.__init__(self, name) |
305 | @@ -240,4 +242,9 @@ | |||
306 | 240 | def logging_name(self, identity): | 242 | def logging_name(self, identity): |
307 | 241 | return self.client.logging_name(identity) | 243 | return self.client.logging_name(identity) |
308 | 242 | 244 | ||
309 | 245 | def truncation_point(self, response, event=None): | ||
310 | 246 | if response.get('target', None) in self.client.channels: | ||
311 | 247 | return self.max_public_message_length | ||
312 | 248 | return None | ||
313 | 249 | |||
314 | 243 | # vi: set et sta sw=4 ts=4: | 250 | # vi: set et sta sw=4 ts=4: |
315 | 244 | 251 | ||
316 | === modified file 'scripts/ibid-plugin' | |||
317 | --- scripts/ibid-plugin 2010-01-04 22:04:04 +0000 | |||
318 | +++ scripts/ibid-plugin 2010-01-07 12:26:15 +0000 | |||
319 | @@ -62,7 +62,12 @@ | |||
320 | 62 | type = 'test' | 62 | type = 'test' |
321 | 63 | permissions = [] | 63 | permissions = [] |
322 | 64 | supports = ('action', 'multiline', 'notice') | 64 | supports = ('action', 'multiline', 'notice') |
324 | 65 | logging_name = lambda self, name: name | 65 | |
325 | 66 | def logging_name(self, name): | ||
326 | 67 | return name | ||
327 | 68 | |||
328 | 69 | def truncation_point(self, response, event=None): | ||
329 | 70 | return None | ||
330 | 66 | 71 | ||
331 | 67 | ibid.sources[u'test_source'] = TestSource() | 72 | ibid.sources[u'test_source'] = TestSource() |
332 | 68 | 73 |
Urgent merge, but probably a little controversial