summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-02-01 17:45:26 +0100
committerYorhel <git@yorhel.nl>2010-02-01 17:45:26 +0100
commit0c5c9bab2c022e251024cc2bd222bd7585ca6837 (patch)
tree841a3aebf4c9933e8cfdb37b02ef1b6fe272cecf /lib/VNDB/DB/Users.pm
parent1dd46f31b7bc117d4a02515175b925bf1be2de92 (diff)
Cache the title and userid of the notifications
These aren't likely to change anyway, and things will become less easy to display when other types of notifications are added.
Diffstat (limited to 'lib/VNDB/DB/Users.pm')
-rw-r--r--lib/VNDB/DB/Users.pm11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm
index 63ac2270..bade6ca1 100644
--- a/lib/VNDB/DB/Users.pm
+++ b/lib/VNDB/DB/Users.pm
@@ -177,21 +177,14 @@ sub dbNotifyGet {
);
my @join = (
- $o{what} =~ /titles/ ? (
- q|LEFT JOIN threads t ON n.ltype = 't' AND t.id = n.iid|,
- q|LEFT JOIN threads_posts tp ON n.ltype = 't' AND tp.tid = t.id AND n.subid = tp.num|,
- q|LEFT JOIN users tu ON tp.uid = tu.id|
- ) : ()
+ $o{what} =~ /titles/ ? 'LEFT JOIN users u ON n.c_byuser = u.id' : (),
);
my @select = (
qw|n.id n.ntype n.ltype n.iid n.subid|,
q|extract('epoch' from n.date) as date|,
q|extract('epoch' from n.read) as read|,
- $o{what} =~ /titles/ ? (
- q|COALESCE(t.title,'') AS title|,
- q|COALESCE(tu.username,'') AS subtitle|,
- ) : (),
+ $o{what} =~ /titles/ ? qw|u.username n.c_title| : (),
);
my($r, $np) = $s->dbPage(\%o, q|