18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/iirc/modules/ircv3/batches.rb', line 18
def receive_batches evt
return if evt.is_a? Batch
if evt.verb == :batch
± = evt.target[0]
id = evt.target[1..]
if ± == '+'
batches_in_flight[id] = Batch.new(
sender: evt.sender,
verb: evt.verb,
args: evt.args.dup.tap { |args| args[0] = id },
tags: evt.tags,
)
else
fire! :batch, batches_in_flight.delete(id)
end
raise StopIteration
elsif evt.tags['batch']
id = evt.tags['batch']
batches_in_flight[id].events << evt
end
end
|