summaryrefslogtreecommitdiff
path: root/lib/Multi/IRC.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-02-19 10:55:57 +0100
committerYorhel <git@yorhel.nl>2011-02-19 10:55:57 +0100
commit03b61b55ed44580074e9bfb7972e75f943c2487c (patch)
tree77eed0972d19358638dcd88a0adb399e85039fa8 /lib/Multi/IRC.pm
parentdaf605104b5181341b52465f7574f7451f2008ff (diff)
chardb: Made bb2html() and Multi::IRC aware of c+, c+.+ and i+
Diffstat (limited to 'lib/Multi/IRC.pm')
-rw-r--r--lib/Multi/IRC.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Multi/IRC.pm b/lib/Multi/IRC.pm
index 13e0e168..2cd2e813 100644
--- a/lib/Multi/IRC.pm
+++ b/lib/Multi/IRC.pm
@@ -282,11 +282,12 @@ sub notify { # name, pid, payload
my $q = $_[ARG0] eq 'newrevision' ? q|SELECT
c.type, c.rev, c.comments, c.id AS lastrev,
- COALESCE(vr.vid, rr.rid, pr.pid) AS id, COALESCE(vr.title, rr.title, pr.name) AS title, u.username
+ COALESCE(vr.vid, rr.rid, pr.pid, cr.cid) AS id, COALESCE(vr.title, rr.title, pr.name, cr.name) AS title, u.username
FROM changes c
LEFT JOIN vn_rev vr ON c.type = 'v' AND c.id = vr.id
LEFT JOIN releases_rev rr ON c.type = 'r' AND c.id = rr.id
LEFT JOIN producers_rev pr ON c.type = 'p' AND c.id = pr.id
+ LEFT JOIN chars_rev cr ON c.type = 'c' AND c.id = cr.id
JOIN users u ON u.id = c.requester
WHERE c.id > ? AND c.requester <> 1
ORDER BY c.added|
@@ -537,8 +538,8 @@ sub vndbid { # dest, msg
my @id; # [ type, id, ref ]
for (split /[, ]/, $msg) {
next if length > 15 or m{[a-z]{3,6}://}i; # weed out URLs and too long things
- push @id, /^(?:.*[^\w]|)([dvprt])([1-9][0-9]*)\.([1-9][0-9]*)(?:[^\w].*|)$/ ? [ $1, $2, $3 ] # x+.+
- : /^(?:.*[^\w]|)([dvprtugi])([1-9][0-9]*)(?:[^\w].*|)$/ ? [ $1, $2, 0 ] : (); # x+
+ push @id, /^(?:.*[^\w]|)([dvprtc])([1-9][0-9]*)\.([1-9][0-9]*)(?:[^\w].*|)$/ ? [ $1, $2, $3 ] # x+.+
+ : /^(?:.*[^\w]|)([dvprtugic])([1-9][0-9]*)(?:[^\w].*|)$/ ? [ $1, $2, 0 ] : (); # x+
}
for (@id) {
@@ -550,21 +551,23 @@ sub vndbid { # dest, msg
$t eq 'v' ? 'vr.title FROM vn_rev vr JOIN vn v ON v.latest = vr.id WHERE v.id = ?' :
$t eq 'u' ? 'u.username AS title FROM users u WHERE u.id = ?' :
$t eq 'p' ? 'pr.name AS title FROM producers_rev pr JOIN producers p ON p.latest = pr.id WHERE p.id = ?' :
+ $t eq 'c' ? 'cr.name AS title FROM chars_rev cr JOIN chars c ON c.latest = cr.id WHERE c.id = ?' :
$t eq 't' ? 'title, '.GETBOARDS.' FROM threads t WHERE id = ?' :
$t eq 'g' ? 'name AS title FROM tags WHERE id = ?' :
$t eq 'i' ? 'name AS title FROM traits WHERE id = ?' :
'rr.title FROM releases_rev rr JOIN releases r ON r.latest = rr.id WHERE r.id = ?'),
[ $t, $id, $id ], 'formatid', [$dest]
- ) if !$rev && $t =~ /[vprtugi]/;
+ ) if !$rev && $t =~ /[vprtugic]/;
# edit/insert of vn/release/producer or discussion board post
$_[KERNEL]->post(pg => query => 'SELECT ?::text AS type, ?::integer AS id, ?::integer AS rev, '.(
$t eq 'v' ? 'vr.title, u.username, c.comments FROM changes c JOIN vn_rev vr ON c.id = vr.id JOIN users u ON u.id = c.requester WHERE vr.vid = ? AND c.rev = ?' :
$t eq 'r' ? 'rr.title, u.username, c.comments FROM changes c JOIN releases_rev rr ON c.id = rr.id JOIN users u ON u.id = c.requester WHERE rr.rid = ? AND c.rev = ?' :
$t eq 'p' ? 'pr.name AS title, u.username, c.comments FROM changes c JOIN producers_rev pr ON c.id = pr.id JOIN users u ON u.id = c.requester WHERE pr.pid = ? AND c.rev = ?' :
+ $t eq 'c' ? 'cr.name AS title, u.username, h.comments FROM changes h JOIN chars_rev cr ON h.id = cr.id JOIN users u ON u.id = h.requester WHERE cr.cid = ? AND h.rev = ?' :
't.title, u.username, '.GETBOARDS.' FROM threads t JOIN threads_posts tp ON tp.tid = t.id JOIN users u ON u.id = tp.uid WHERE t.id = ? AND tp.num = ?'),
[ $t, $id, $rev, $id, $rev], 'formatid', [$dest]
- ) if $rev && $t =~ /[vprt]/;
+ ) if $rev && $t =~ /[vprtc]/;
# documentation page (need to parse the doc pages manually here)
if($t eq 'd') {