summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <git@evanprodromou.name>2009-01-30 11:28:05 -0500
committerEvan Prodromou <git@evanprodromou.name>2009-01-30 11:28:05 -0500
commit5612cbd4a4777fecd89a5dcb526151afd6363eca (patch)
treec7b5c0a1156b26ed260061d4b285795cee61be19 /lib
parent153208aaa6eff9ad56b5dac374197684f0cf93b6 (diff)
parent53274a6d9347c256430187a22347ca4a0910a395 (diff)
Merge branch 'master' of git://gitorious.org/laconica/CiaranG into ciarang/master
Diffstat (limited to 'lib')
-rw-r--r--lib/jabber.php27
-rw-r--r--lib/mail.php9
2 files changed, 19 insertions, 17 deletions
diff --git a/lib/jabber.php b/lib/jabber.php
index 6196bc9e1..f1be57768 100644
--- a/lib/jabber.php
+++ b/lib/jabber.php
@@ -354,12 +354,13 @@ function jabber_broadcast_notice($notice)
// First, get users to whom this is a direct reply
$user = new User();
- $user->query('SELECT user.id, user.jabber ' .
- 'FROM user JOIN reply ON user.id = reply.profile_id ' .
+ $UT = common_config('db','type')=='pgsql'?'"user"':'user';
+ $user->query("SELECT $UT.id, $UT.jabber " .
+ "FROM $UT JOIN reply ON $UT.id = reply.profile_id " .
'WHERE reply.notice_id = ' . $notice->id . ' ' .
- 'AND user.jabber is not null ' .
- 'AND user.jabbernotify = 1 ' .
- 'AND user.jabberreplies = 1 ');
+ "AND $UT.jabber is not null " .
+ "AND $UT.jabbernotify = 1 " .
+ "AND $UT.jabberreplies = 1 ");
while ($user->fetch()) {
common_log(LOG_INFO,
@@ -375,12 +376,12 @@ function jabber_broadcast_notice($notice)
// Now, get users subscribed to this profile
$user = new User();
- $user->query('SELECT user.id, user.jabber ' .
- 'FROM user JOIN subscription ' .
- 'ON user.id = subscription.subscriber ' .
+ $user->query("SELECT $UT.id, $UT.jabber " .
+ "FROM $UT JOIN subscription " .
+ "ON $UT.id = subscription.subscriber " .
'WHERE subscription.subscribed = ' . $notice->profile_id . ' ' .
- 'AND user.jabber is not null ' .
- 'AND user.jabbernotify = 1 ' .
+ "AND $UT.jabber is not null " .
+ "AND $UT.jabbernotify = 1 " .
'AND subscription.jabber = 1 ');
while ($user->fetch()) {
@@ -399,9 +400,9 @@ function jabber_broadcast_notice($notice)
// Now, get users who have it in their inbox because of groups
$user = new User();
- $user->query('SELECT user.id, user.jabber ' .
- 'FROM user JOIN notice_inbox ' .
- 'ON user.id = notice_inbox.user_id ' .
+ $user->query("SELECT $UT.id, $UT.jabber " .
+ "FROM $UT JOIN notice_inbox " .
+ "ON $UT.id = notice_inbox.user_id " .
'WHERE notice_inbox.notice_id = ' . $notice->id . ' ' .
'AND notice_inbox.source = 2 ' .
'AND user.jabber is not null ' .
diff --git a/lib/mail.php b/lib/mail.php
index 1c6a10a8a..b424d579f 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -331,12 +331,13 @@ function mail_broadcast_notice_sms($notice)
$user = new User();
+ $UT = common_config('db','type')=='pgsql'?'"user"':'user';
$user->query('SELECT nickname, smsemail, incomingemail ' .
- 'FROM user JOIN subscription ' .
- 'ON user.id = subscription.subscriber ' .
+ "FROM $UT JOIN subscription " .
+ "ON $UT.id = subscription.subscriber " .
'WHERE subscription.subscribed = ' . $notice->profile_id . ' ' .
- 'AND user.smsemail IS NOT null ' .
- 'AND user.smsnotify = 1 ' .
+ "AND $UT.smsemail IS NOT null " .
+ "AND $UT.smsnotify = 1 " .
'AND subscription.sms = 1 ');
while ($user->fetch()) {