summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-09-30 10:32:05 -0700
committerZach Copley <zach@status.net>2009-09-30 10:32:05 -0700
commit5bab0288afe90996729101df1372071e1bf2cffc (patch)
tree6f715547d0cb1cf632c7be4e596fa4d45f347f41 /scripts
parent34ba2d03e94d3708a68166a8eae248152691f628 (diff)
parenta57783de0214f061eca3ab65880f573e8668de03 (diff)
Merge branch '0.9.x' into refactor-api
* 0.9.x: (39 commits) Timeout a little incase the notice item from XHR response is Relocated the button for pop up window for notice stream Script no longer needed for Realtime plugin Better check to see if the XML prolog should be outputted for XML Outputting UTF-8 charset in document header irrespective of mimetype. Switched Doctype to XHTML 1.0 Strict (which best reflects the current Twitter API returns server errors in preferred format move HTTP error code strings to class variables remove string-checks from code using Notice::saveNew() change string return from Notice::saveNew to exceptions stop overwriting created timestamp on group edit Forgot to add home_timeline to the list of methods that only require Forgot to add home_timeline to the list of methods that only require moderator can delete another user's notice show delete button when user has deleteOthersNotice right let hooks override standard user rights user rights Merge DeleteAction class into DeletenoticeAction Fix some bugs in the URL linkification, and fixed the unit test. Fix URL linkification test cases for addition of 'title' attribution with long URL in f3c8fccc ...
Diffstat (limited to 'scripts')
-rw-r--r--scripts/createsim.php2
-rwxr-xr-xscripts/maildaemon.php9
-rwxr-xr-xscripts/xmppdaemon.php11
3 files changed, 13 insertions, 9 deletions
diff --git a/scripts/createsim.php b/scripts/createsim.php
index 71ed3bf72..1266a9700 100644
--- a/scripts/createsim.php
+++ b/scripts/createsim.php
@@ -101,7 +101,7 @@ function newSub($i)
$to = User::staticGet('nickname', $tunic);
- if (empty($from)) {
+ if (empty($to)) {
throw new Exception("Can't find user '$tunic'.");
}
diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php
index 5705cfd50..586bef624 100755
--- a/scripts/maildaemon.php
+++ b/scripts/maildaemon.php
@@ -260,10 +260,11 @@ class MailerDaemon
function add_notice($user, $msg, $fileRecords)
{
- $notice = Notice::saveNew($user->id, $msg, 'mail');
- if (is_string($notice)) {
- $this->log(LOG_ERR, $notice);
- return $notice;
+ try {
+ $notice = Notice::saveNew($user->id, $msg, 'mail');
+ } catch (Exception $e) {
+ $this->log(LOG_ERR, $e->getMessage());
+ return $e->getMessage();
}
foreach($fileRecords as $fileRecord){
$this->attachFile($notice, $fileRecord);
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php
index 1b1aec3e6..b2efc07c3 100755
--- a/scripts/xmppdaemon.php
+++ b/scripts/xmppdaemon.php
@@ -323,12 +323,15 @@ class XMPPDaemon extends Daemon
mb_strlen($content_shortened)));
return;
}
- $notice = Notice::saveNew($user->id, $content_shortened, 'xmpp');
- if (is_string($notice)) {
- $this->log(LOG_ERR, $notice);
- $this->from_site($user->jabber, $notice);
+
+ try {
+ $notice = Notice::saveNew($user->id, $content_shortened, 'xmpp');
+ } catch (Exception $e) {
+ $this->log(LOG_ERR, $e->getMessage());
+ $this->from_site($user->jabber, $e->getMessage());
return;
}
+
common_broadcast_notice($notice);
$this->log(LOG_INFO,
'Added notice ' . $notice->id . ' from user ' . $user->nickname);