diff --git a/include/conversation.php b/include/conversation.php index 6b7c3afb..7f4c5bc3 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -413,6 +413,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { if(!$update) { $tab = notags(trim($_GET['tab'])); + $tab = ( $tab ? $tab : 'posts' ); if($tab === 'posts') { // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, // because browser prefetching might change it on us. We have to deliver it with the page. diff --git a/include/onepoll.php b/include/onepoll.php index 17588d18..9fbef168 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -292,7 +292,12 @@ function onepoll_run($argv, $argc){ logger("Mail: Parsing ".count($msgs)." mails for ".$mailconf[0]['user'], LOGGER_DEBUG); $metas = email_msg_meta($mbox,implode(',',$msgs)); + if(count($metas) != count($msgs)) { + logger("onepoll: for " . $mailconf[0]['user'] . " there are ". count($msgs) . " messages but received " . count($metas) . " metas", LOGGER_DEBUG); + break; + } $msgs = array_combine($msgs, $metas); + foreach($msgs as $msg_uid => $meta) { logger("Mail: Parsing mail ".$msg_uid, LOGGER_DATA); @@ -309,7 +314,7 @@ function onepoll_run($argv, $argc){ ); if(count($r)) { - logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user']); + logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user'],LOGGER_DEBUG); if($meta->deleted && ! $r[0]['deleted']) { q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", dbesc(datetime_convert()), diff --git a/include/redir.php b/include/redir.php index 42008ddd..7a440361 100644 --- a/include/redir.php +++ b/include/redir.php @@ -7,10 +7,23 @@ function auto_redir(&$a, $contact_nick) { if(local_user()) { - $r = q("SELECT id FROM contact WHERE uid = ( SELECT uid FROM user WHERE nickname = '%s' LIMIT 1 ) AND nick = '%s' AND network = '%s' and self = 0 LIMIT 1", + // We need to find out if $contact_nick is a user on this hub, and if so, if I + // am a contact of that user. However, that user may have other contacts with the + // same nickname as me on other hubs or other networks. Exclude these by requiring + // that the contact have a local URL. I will be the only person with my nickname at + // this URL, so if a result is found, then I am a contact of the $contact_nick user. + + $baseurl = $a->get_baseurl(); + $domain_st = strpos($baseurl, "://"); + if($domain_st === false) + return; + $baseurl = substr($baseurl, $domain_st + 3); + + $r = q("SELECT id FROM contact WHERE uid = ( SELECT uid FROM user WHERE nickname = '%s' LIMIT 1 ) + AND nick = '%s' AND self = 0 AND url LIKE '%%%s%%' LIMIT 1", dbesc($contact_nick), dbesc($a->user['nickname']), - dbesc(NETWORK_DFRN) + dbesc($baseurl) ); if((!$r) || (! count($r)) || $r[0]['id'] == remote_user()) @@ -52,7 +65,7 @@ function auto_redir(&$a, $contact_nick) { $url = curPageURL(); - logger('check_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG); + logger('auto_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG); $dest = (($url) ? '&destination_url=' . $url : ''); goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest ); diff --git a/view/theme/facepark/contact_template.tpl b/view/theme/facepark/contact_template.tpl deleted file mode 100644 index 48930b48..00000000 --- a/view/theme/facepark/contact_template.tpl +++ /dev/null @@ -1,25 +0,0 @@ - -
-
-
- - $contact.name - - {{ if $contact.photo_menu }} - menu -
-
    - $contact.photo_menu -
-
- {{ endif }} -
- -
-
-
$contact.name
- -
-
diff --git a/view/theme/facepark/conversation.tpl b/view/theme/facepark/conversation.tpl deleted file mode 100644 index 0e146462..00000000 --- a/view/theme/facepark/conversation.tpl +++ /dev/null @@ -1,29 +0,0 @@ -$live_update - -{{ for $threads as $thread }} -
- {{ for $thread.items as $item }} - {{if $item.comment_firstcollapsed}} -
- $thread.num_comments $thread.hide_text -
- {{endif}} - - {{ inc $item.template }}{{ endinc }} - - - {{ endfor }} -
-{{ endfor }} - -
- -{{ if $dropping }} - -
-{{ endif }} diff --git a/view/theme/facepark/nets.tpl b/view/theme/facepark/nets.tpl deleted file mode 100644 index 920c2332..00000000 --- a/view/theme/facepark/nets.tpl +++ /dev/null @@ -1,10 +0,0 @@ -
-

$title

-
$desc
- $all - -
diff --git a/view/theme/facepark/saved_searches_aside.tpl b/view/theme/facepark/saved_searches_aside.tpl deleted file mode 100644 index e6a0d627..00000000 --- a/view/theme/facepark/saved_searches_aside.tpl +++ /dev/null @@ -1,14 +0,0 @@ -
- - $searchbox - - -
-
diff --git a/view/theme/frost-mobile/oembed_video.tpl b/view/theme/frost-mobile/oembed_video.tpl deleted file mode 100755 index d3a9a931..00000000 --- a/view/theme/frost-mobile/oembed_video.tpl +++ /dev/null @@ -1,4 +0,0 @@ - - -
-
diff --git a/view/theme/frost/oembed_video.tpl b/view/theme/frost/oembed_video.tpl deleted file mode 100755 index d3a9a931..00000000 --- a/view/theme/frost/oembed_video.tpl +++ /dev/null @@ -1,4 +0,0 @@ - - -
-
diff --git a/view/theme/quattro/msg-header.tpl b/view/theme/quattro/msg-header.tpl deleted file mode 100644 index 2d1ea7a6..00000000 --- a/view/theme/quattro/msg-header.tpl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - diff --git a/view/theme/quattro/threaded_conversation.tpl b/view/theme/quattro/threaded_conversation.tpl index 94be8641..7eadf7e9 100644 --- a/view/theme/quattro/threaded_conversation.tpl +++ b/view/theme/quattro/threaded_conversation.tpl @@ -1,3 +1,5 @@ +$live_update + {{ for $threads as $item }}
diff --git a/view/theme/testbubble/contact_template.tpl b/view/theme/testbubble/contact_template.tpl deleted file mode 100644 index 48930b48..00000000 --- a/view/theme/testbubble/contact_template.tpl +++ /dev/null @@ -1,25 +0,0 @@ - -
-
-
- - $contact.name - - {{ if $contact.photo_menu }} - menu -
-
    - $contact.photo_menu -
-
- {{ endif }} -
- -
-
-
$contact.name
- -
-
diff --git a/view/theme/testbubble/mail_head.tpl b/view/theme/testbubble/mail_head.tpl deleted file mode 100644 index afb65f53..00000000 --- a/view/theme/testbubble/mail_head.tpl +++ /dev/null @@ -1,3 +0,0 @@ -

$messages

- -$tab_content diff --git a/view/theme/testbubble/nets.tpl b/view/theme/testbubble/nets.tpl deleted file mode 100644 index 920c2332..00000000 --- a/view/theme/testbubble/nets.tpl +++ /dev/null @@ -1,10 +0,0 @@ -
-

$title

-
$desc
- $all - -
diff --git a/view/theme/vier/contact_template.tpl b/view/theme/vier/contact_template.tpl deleted file mode 100644 index 48930b48..00000000 --- a/view/theme/vier/contact_template.tpl +++ /dev/null @@ -1,25 +0,0 @@ - -
-
-
- - $contact.name - - {{ if $contact.photo_menu }} - menu -
-
    - $contact.photo_menu -
-
- {{ endif }} -
- -
-
-
$contact.name
- -
-