From 4990f64927e2ddd65e1a1f4b1ef85fec12fb98a9 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Mon, 29 Oct 2012 12:03:48 -0600 Subject: [PATCH 1/5] make sure that the contact is local for auto redir --- include/redir.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/include/redir.php b/include/redir.php index 42008ddd6..7a4403613 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 ); From 4fd339b216981c104e77455731974b1816355aca Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Mon, 29 Oct 2012 12:43:52 -0600 Subject: [PATCH 2/5] add live div to wall page --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/conversation.php b/include/conversation.php index 6b7c3afb0..7f4c5bc3d 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. From 200d2030d512eab41fa018ae3dd0776ab68fba7f Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Mon, 29 Oct 2012 12:47:51 -0600 Subject: [PATCH 3/5] don't combine msg and meta arrays unless they're the same size --- include/onepoll.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/onepoll.php b/include/onepoll.php index 17588d183..9fbef168c 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()), From 4fa5b761673918396b06b011cedcfe79ecfd4fcc Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Mon, 29 Oct 2012 12:56:17 -0600 Subject: [PATCH 4/5] delete template files that are identical to the defaults --- view/theme/facepark/contact_template.tpl | 25 ----- view/theme/facepark/conversation.tpl | 29 ------ view/theme/facepark/nets.tpl | 10 -- view/theme/facepark/saved_searches_aside.tpl | 14 --- view/theme/frost-mobile/oembed_video.tpl | 4 - view/theme/frost/oembed_video.tpl | 4 - view/theme/quattro/msg-header.tpl | 97 -------------------- view/theme/testbubble/contact_template.tpl | 25 ----- view/theme/testbubble/mail_head.tpl | 3 - view/theme/testbubble/nets.tpl | 10 -- view/theme/vier/contact_template.tpl | 25 ----- 11 files changed, 246 deletions(-) delete mode 100644 view/theme/facepark/contact_template.tpl delete mode 100644 view/theme/facepark/conversation.tpl delete mode 100644 view/theme/facepark/nets.tpl delete mode 100644 view/theme/facepark/saved_searches_aside.tpl delete mode 100755 view/theme/frost-mobile/oembed_video.tpl delete mode 100755 view/theme/frost/oembed_video.tpl delete mode 100644 view/theme/quattro/msg-header.tpl delete mode 100644 view/theme/testbubble/contact_template.tpl delete mode 100644 view/theme/testbubble/mail_head.tpl delete mode 100644 view/theme/testbubble/nets.tpl delete mode 100644 view/theme/vier/contact_template.tpl diff --git a/view/theme/facepark/contact_template.tpl b/view/theme/facepark/contact_template.tpl deleted file mode 100644 index 48930b48a..000000000 --- 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 0e1464621..000000000 --- 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 920c2332b..000000000 --- a/view/theme/facepark/nets.tpl +++ /dev/null @@ -1,10 +0,0 @@ -
-

$title

-
$desc
- $all -
    - {{ for $nets as $net }} -
  • $net.name
  • - {{ endfor }} -
-
diff --git a/view/theme/facepark/saved_searches_aside.tpl b/view/theme/facepark/saved_searches_aside.tpl deleted file mode 100644 index e6a0d6278..000000000 --- a/view/theme/facepark/saved_searches_aside.tpl +++ /dev/null @@ -1,14 +0,0 @@ -
- - $searchbox - -
    - {{ for $saved as $search }} -
  • - - $search.term -
  • - {{ endfor }} -
-
-
diff --git a/view/theme/frost-mobile/oembed_video.tpl b/view/theme/frost-mobile/oembed_video.tpl deleted file mode 100755 index d3a9a9311..000000000 --- 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 d3a9a9311..000000000 --- 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 2d1ea7a61..000000000 --- a/view/theme/quattro/msg-header.tpl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - diff --git a/view/theme/testbubble/contact_template.tpl b/view/theme/testbubble/contact_template.tpl deleted file mode 100644 index 48930b48a..000000000 --- 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 afb65f537..000000000 --- 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 920c2332b..000000000 --- a/view/theme/testbubble/nets.tpl +++ /dev/null @@ -1,10 +0,0 @@ -
-

$title

-
$desc
- $all -
    - {{ for $nets as $net }} -
  • $net.name
  • - {{ endfor }} -
-
diff --git a/view/theme/vier/contact_template.tpl b/view/theme/vier/contact_template.tpl deleted file mode 100644 index 48930b48a..000000000 --- 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
- -
-
From 2bfacda2df043f4b1ab2df7e40c5beb2f7203a9e Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Mon, 29 Oct 2012 13:04:59 -0600 Subject: [PATCH 5/5] missed quattro threaded_conversation live update field --- view/theme/quattro/threaded_conversation.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/view/theme/quattro/threaded_conversation.tpl b/view/theme/quattro/threaded_conversation.tpl index 94be86417..7eadf7e9f 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 }}