function common_fancy_url($action, $args=NULL) {
switch (strtolower($action)) {
case 'public':
- if ($args && $args['page']) {
+ if ($args && isset($args['page'])) {
return common_path('?page=' . $args['page']);
} else {
return common_path('');
return common_path('settings/email');
case 'openidsettings':
return common_path('settings/openid');
+ case 'smssettings':
+ return common_path('settings/sms');
case 'newnotice':
if ($args && $args['replyto']) {
return common_path('notice/new?replyto='.$args['replyto']);
case 'userrss':
return common_path($args['nickname'].'/rss');
case 'showstream':
- if ($args && $args['page']) {
+ if ($args && isset($args['page'])) {
return common_path($args['nickname'].'?page=' . $args['page']);
} else {
return common_path($args['nickname']);
function common_save_replies($notice) {
# Alternative reply format
+ $tname = false;
if (preg_match('/^T ([A-Z0-9]{1,64}) /', $notice->content, $match)) {
$tname = $match[1];
}
common_log(LOG_ERR, 'Error in jabber broadcast for notice ' . $notice->id);
}
}
- // XXX: broadcast notices to SMS
+ if ($success) {
+ require_once(INSTALLDIR.'/lib/mail.php');
+ $success = mail_broadcast_notice_sms($notice);
+ if (!$success) {
+ common_log(LOG_ERR, 'Error in sms broadcast for notice ' . $notice->id);
+ }
+ }
// XXX: broadcast notices to other IM
return $success;
}
}
# XXX: this is a very bad profile!
return NULL;
+}
+
+function common_canonical_sms($sms) {
+ # strip non-digits
+ preg_replace('/\D/', '', $sms);
+ return $sms;
}
\ No newline at end of file