recursion and typo in rmagic with zid

This commit is contained in:
friendica 2013-02-13 00:14:01 -08:00
parent 02c636ed23
commit d1e5337c72
4 changed files with 3 additions and 41 deletions

View File

@ -341,41 +341,6 @@ function notification($params) {
logger('notification: sending notification email'); logger('notification: sending notification email');
$id_for_parent = "${params['parent']}@${hostname}";
// Is this the first email notification for this parent item and user?
$r = q("select `id` from `notify-threads` where `master-parent-item` = %d and `receiver-uid` = %d limit 1",
intval($params['parent']),
intval($datarray['uid']) );
// If so, create the record of it and use a message-id smtp header.
if(!$r) {
logger("notify_id:" . intval($notify_id). ", parent: " . intval($params['parent']) . "uid: " .
intval($params['uid']), LOGGER_DEBUG);
$r = q("insert into `notify-threads` (`notify-id`, `master-parent-item`, `receiver-uid`, `parent-item`)
values(%d,%d,%d,%d)",
intval($notify_id),
intval($params['parent']),
intval($params['uid']),
0 );
$additional_mail_header .= "Message-ID: <${id_for_parent}>\n";
$log_msg = "include/enotify: No previous notification found for this parent:\n" .
" parent: ${params['parent']}\n" . " uid : ${params['uid']}\n";
logger($log_msg, LOGGER_DEBUG);
}
// If not, just "follow" the thread.
else {
$additional_mail_header = "References: <${id_for_parent}>\nIn-Reply-To: <${id_for_parent}>\n";
logger("include/enotify: There's already a notification for this parent:\n" . print_r($r, true), LOGGER_DEBUG);
}
$textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n", $textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n",
$body))),ENT_QUOTES,'UTF-8')); $body))),ENT_QUOTES,'UTF-8'));
$htmlversion = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), $htmlversion = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"),

View File

@ -49,10 +49,6 @@ function zot_get_hubloc($arr,$primary = false) {
function zot_notify($channel,$url,$type = 'notify',$recipients = null, $remote_key = null) { function zot_notify($channel,$url,$type = 'notify',$recipients = null, $remote_key = null) {
// FIXME json encode all params
// build the packet externally so that here we really are doing just a zot of the packet.
$params = array( $params = array(
'type' => $type, 'type' => $type,
'sender' => json_encode(array( 'sender' => json_encode(array(

View File

@ -111,7 +111,8 @@ function post_init(&$a) {
logger('mod_zot: auth success from ' . $x[0]['xchan_addr'] . ' for ' . $webbie); logger('mod_zot: auth success from ' . $x[0]['xchan_addr'] . ' for ' . $webbie);
} }
if(strstr($desturl,z_root() . '/rmagic'))
goaway(z_root());
goaway($desturl); goaway($desturl);
} }

View File

@ -14,7 +14,7 @@ function rmagic_init(&$a) {
if($r) { if($r) {
if($r[0]['hubloc_url'] === z_root()) if($r[0]['hubloc_url'] === z_root())
goaway(z_root() . '/login'); goaway(z_root() . '/login');
$dest = z_root() . '/' . str_replace('zid=','zid_=',$get_app()->query_string); $dest = z_root() . '/' . str_replace('zid=','zid_=',get_app()->query_string);
goaway($r[0]['hubloc_url'] . '/magic' . '?f=&dest=' . $dest); goaway($r[0]['hubloc_url'] . '/magic' . '?f=&dest=' . $dest);
} }
} }