]> git.mxchange.org Git - friendica.git/commitdiff
Merge https://github.com/friendica/friendica into pull
authorfriendica <info@friendica.com>
Tue, 30 Oct 2012 04:01:08 +0000 (21:01 -0700)
committerfriendica <info@friendica.com>
Tue, 30 Oct 2012 04:01:08 +0000 (21:01 -0700)
15 files changed:
include/conversation.php
include/onepoll.php
include/redir.php
view/theme/facepark/contact_template.tpl [deleted file]
view/theme/facepark/conversation.tpl [deleted file]
view/theme/facepark/nets.tpl [deleted file]
view/theme/facepark/saved_searches_aside.tpl [deleted file]
view/theme/frost-mobile/oembed_video.tpl [deleted file]
view/theme/frost/oembed_video.tpl [deleted file]
view/theme/quattro/msg-header.tpl [deleted file]
view/theme/quattro/threaded_conversation.tpl
view/theme/testbubble/contact_template.tpl [deleted file]
view/theme/testbubble/mail_head.tpl [deleted file]
view/theme/testbubble/nets.tpl [deleted file]
view/theme/vier/contact_template.tpl [deleted file]

index 6b7c3afb031ceac2174d3a139a07b7c2fd146944..7f4c5bc3d22050fd6ff7c06f76390d910fc299dc 100644 (file)
@@ -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.
index 17588d183f16e863fb9c213729e9b5145b27a798..9fbef168c6fa4d594f1fc875ce430794c616b959 100644 (file)
@@ -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()),
index 42008ddd6b78d7ef289d48f6cb61ea04b3f4b86c..7a4403613197405ab1c3f6fe18692c90d7c5c477 100644 (file)
@@ -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 (file)
index 48930b4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-<div class="contact-entry-wrapper" id="contact-entry-wrapper-$contact.id" >
-       <div class="contact-entry-photo-wrapper" >
-               <div class="contact-entry-photo mframe" id="contact-entry-photo-$contact.id"
-               onmouseover="if (typeof t$contact.id != 'undefined') clearTimeout(t$contact.id); openMenu('contact-photo-menu-button-$contact.id')" 
-               onmouseout="t$contact.id=setTimeout('closeMenu(\'contact-photo-menu-button-$contact.id\'); closeMenu(\'contact-photo-menu-$contact.id\');',200)" >
-
-                       <a href="$contact.url" title="$contact.img_hover" /><img src="$contact.thumb" $contact.sparkle alt="$contact.name" /></a>
-
-                       {{ if $contact.photo_menu }}
-                       <span onclick="openClose('contact-photo-menu-$contact.id');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-$contact.id">menu</span>
-                <div class="contact-photo-menu" id="contact-photo-menu-$contact.id">
-                    <ul>
-                        $contact.photo_menu
-                    </ul>
-                </div>
-                       {{ endif }}
-               </div>
-                       
-       </div>
-       <div class="contact-entry-photo-end" ></div>
-               <div class="contact-entry-name" id="contact-entry-name-$contact.id" >$contact.name</div>
-
-       <div class="contact-entry-end" ></div>
-</div>
diff --git a/view/theme/facepark/conversation.tpl b/view/theme/facepark/conversation.tpl
deleted file mode 100644 (file)
index 0e14646..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-$live_update
-
-{{ for $threads as $thread }}
-<div id="tread-wrapper-$thread.id" class="tread-wrapper">
-       {{ for $thread.items as $item }}
-               {{if $item.comment_firstcollapsed}}
-                       <div class="hide-comments-outer">
-                       <span id="hide-comments-total-$thread.id" class="hide-comments-total">$thread.num_comments</span> <span id="hide-comments-$thread.id" class="hide-comments fakelink" onclick="showHideComments($thread.id);">$thread.hide_text</span>
-                       </div>
-                       <div id="collapsed-comments-$thread.id" class="collapsed-comments" style="display: none;">
-               {{endif}}
-               {{if $item.comment_lastcollapsed}}</div>{{endif}}
-               
-               {{ inc $item.template }}{{ endinc }}
-               
-               
-       {{ endfor }}
-</div>
-{{ endfor }}
-
-<div id="conversation-end"></div>
-
-{{ if $dropping }}
-<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();">
-  <div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
-  <div id="item-delete-selected-desc" >$dropping</div>
-</div>
-<div id="item-delete-selected-end"></div>
-{{ endif }}
diff --git a/view/theme/facepark/nets.tpl b/view/theme/facepark/nets.tpl
deleted file mode 100644 (file)
index 920c233..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<div id="nets-sidebar" class="widget">
-       <h3>$title</h3>
-       <div id="nets-desc">$desc</div>
-       <a href="$base?nets=all" class="nets-link{{ if $sel_all }} nets-selected{{ endif }} nets-all">$all</a>
-       <ul class="nets-ul">
-       {{ for $nets as $net }}
-       <li><a href="$base?nets=$net.ref" class="nets-link{{ if $net.selected }} nets-selected{{ endif }}">$net.name</a></li>
-       {{ endfor }}
-       </ul>
-</div>
diff --git a/view/theme/facepark/saved_searches_aside.tpl b/view/theme/facepark/saved_searches_aside.tpl
deleted file mode 100644 (file)
index e6a0d62..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="widget" id="saved-search-list">
-       <h3 id="search">$title</h3>
-       $searchbox
-       
-       <ul id="saved-search-ul">
-               {{ for $saved as $search }}
-               <li class="saved-search-li clear">
-                       <a title="$search.delete" onclick="return confirmDelete();" id="drop-saved-search-term-$search.id" class="iconspacer savedsearchdrop " href="network/?f=&amp;remove=1&amp;search=$search.encodedterm"></a>
-                       <a id="saved-search-term-$search.id" class="savedsearchterm" href="network/?f=&amp;search=$search.encodedterm">$search.term</a>
-               </li>
-               {{ endfor }}
-       </ul>
-       <div class="clear"></div>
-</div>
diff --git a/view/theme/frost-mobile/oembed_video.tpl b/view/theme/frost-mobile/oembed_video.tpl
deleted file mode 100755 (executable)
index d3a9a93..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<a href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); return false;' style='float:left; margin: 1em; position: relative;'>
-       <img width='$tw' height='$th' src='$turl' >
-       <div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url($baseurl/images/icons/48/play.png) no-repeat center center;'></div>
-</a>
diff --git a/view/theme/frost/oembed_video.tpl b/view/theme/frost/oembed_video.tpl
deleted file mode 100755 (executable)
index d3a9a93..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<a href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); return false;' style='float:left; margin: 1em; position: relative;'>
-       <img width='$tw' height='$th' src='$turl' >
-       <div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url($baseurl/images/icons/48/play.png) no-repeat center center;'></div>
-</a>
diff --git a/view/theme/quattro/msg-header.tpl b/view/theme/quattro/msg-header.tpl
deleted file mode 100644 (file)
index 2d1ea7a..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-
-<script language="javascript" type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
-<script language="javascript" type="text/javascript">
-
-var plaintext = '$editselect';
-
-if(plaintext != 'none') {
-       tinyMCE.init({
-               theme : "advanced",
-               mode : "specific_textareas",
-               editor_selector: /(profile-jot-text|prvmail-text)/,
-               plugins : "bbcode,paste",
-               theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
-               theme_advanced_buttons2 : "",
-               theme_advanced_buttons3 : "",
-               theme_advanced_toolbar_location : "top",
-               theme_advanced_toolbar_align : "center",
-               theme_advanced_blockformats : "blockquote,code",
-               gecko_spellcheck : true,
-               paste_text_sticky : true,
-               entity_encoding : "raw",
-               add_unload_trigger : false,
-               remove_linebreaks : false,
-               force_p_newlines : false,
-               force_br_newlines : true,
-               forced_root_block : '',
-               convert_urls: false,
-               content_css: "$baseurl/view/custom_tinymce.css",
-                    //Character count
-               theme_advanced_path : false,
-               setup : function(ed) {
-                       ed.onInit.add(function(ed) {
-                               ed.pasteAsPlainText = true;
-                               var editorId = ed.editorId;
-                               var textarea = $('#'+editorId);
-                               if (typeof(textarea.attr('tabindex')) != "undefined") {
-                                       $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
-                                       textarea.attr('tabindex', null);
-                               }
-                       });
-               }
-       });
-}
-else
-       $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
-
-
-</script>
-<script type="text/javascript" src="js/ajaxupload.js" ></script>
-<script>
-       $(document).ready(function() {
-               var uploader = new window.AjaxUpload(
-                       'prvmail-upload',
-                       { action: 'wall_upload/$nickname',
-                               name: 'userfile',
-                               onSubmit: function(file,ext) { $('#profile-rotator').show(); },
-                               onComplete: function(file,response) {
-                                       tinyMCE.execCommand('mceInsertRawHTML',false,response);
-                                       $('#profile-rotator').hide();
-                               }                                
-                       }
-               );
-
-       });
-
-       function jotGetLink() {
-               reply = prompt("$linkurl");
-               if(reply && reply.length) {
-                       $('#profile-rotator').show();
-                       $.get('parse_url?url=' + reply, function(data) {
-                               tinyMCE.execCommand('mceInsertRawHTML',false,data);
-                               $('#profile-rotator').hide();
-                       });
-               }
-       }
-
-       function linkdropper(event) {
-               var linkFound = event.dataTransfer.types.contains("text/uri-list");
-               if(linkFound)
-                       event.preventDefault();
-       }
-
-       function linkdrop(event) {
-               var reply = event.dataTransfer.getData("text/uri-list");
-               event.target.textContent = reply;
-               event.preventDefault();
-               if(reply && reply.length) {
-                       $('#profile-rotator').show();
-                       $.get('parse_url?url=' + reply, function(data) {
-                               tinyMCE.execCommand('mceInsertRawHTML',false,data);
-                               $('#profile-rotator').hide();
-                       });
-               }
-       }
-
-</script>
-
index 94be86417423f6692e1b7dc6760a11de15e158d5..7eadf7e9f42c59ad59082b8f963f7304d462da7b 100644 (file)
@@ -1,3 +1,5 @@
+$live_update
+
 {{ for $threads as $item }}
 
 <div id="tread-wrapper-$item.id" class="tread-wrapper {{ if $item.threaded }}threaded{{ endif }}  $item.toplevel">
diff --git a/view/theme/testbubble/contact_template.tpl b/view/theme/testbubble/contact_template.tpl
deleted file mode 100644 (file)
index 48930b4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-<div class="contact-entry-wrapper" id="contact-entry-wrapper-$contact.id" >
-       <div class="contact-entry-photo-wrapper" >
-               <div class="contact-entry-photo mframe" id="contact-entry-photo-$contact.id"
-               onmouseover="if (typeof t$contact.id != 'undefined') clearTimeout(t$contact.id); openMenu('contact-photo-menu-button-$contact.id')" 
-               onmouseout="t$contact.id=setTimeout('closeMenu(\'contact-photo-menu-button-$contact.id\'); closeMenu(\'contact-photo-menu-$contact.id\');',200)" >
-
-                       <a href="$contact.url" title="$contact.img_hover" /><img src="$contact.thumb" $contact.sparkle alt="$contact.name" /></a>
-
-                       {{ if $contact.photo_menu }}
-                       <span onclick="openClose('contact-photo-menu-$contact.id');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-$contact.id">menu</span>
-                <div class="contact-photo-menu" id="contact-photo-menu-$contact.id">
-                    <ul>
-                        $contact.photo_menu
-                    </ul>
-                </div>
-                       {{ endif }}
-               </div>
-                       
-       </div>
-       <div class="contact-entry-photo-end" ></div>
-               <div class="contact-entry-name" id="contact-entry-name-$contact.id" >$contact.name</div>
-
-       <div class="contact-entry-end" ></div>
-</div>
diff --git a/view/theme/testbubble/mail_head.tpl b/view/theme/testbubble/mail_head.tpl
deleted file mode 100644 (file)
index afb65f5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<h3>$messages</h3>
-
-$tab_content
diff --git a/view/theme/testbubble/nets.tpl b/view/theme/testbubble/nets.tpl
deleted file mode 100644 (file)
index 920c233..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<div id="nets-sidebar" class="widget">
-       <h3>$title</h3>
-       <div id="nets-desc">$desc</div>
-       <a href="$base?nets=all" class="nets-link{{ if $sel_all }} nets-selected{{ endif }} nets-all">$all</a>
-       <ul class="nets-ul">
-       {{ for $nets as $net }}
-       <li><a href="$base?nets=$net.ref" class="nets-link{{ if $net.selected }} nets-selected{{ endif }}">$net.name</a></li>
-       {{ endfor }}
-       </ul>
-</div>
diff --git a/view/theme/vier/contact_template.tpl b/view/theme/vier/contact_template.tpl
deleted file mode 100644 (file)
index 48930b4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-<div class="contact-entry-wrapper" id="contact-entry-wrapper-$contact.id" >
-       <div class="contact-entry-photo-wrapper" >
-               <div class="contact-entry-photo mframe" id="contact-entry-photo-$contact.id"
-               onmouseover="if (typeof t$contact.id != 'undefined') clearTimeout(t$contact.id); openMenu('contact-photo-menu-button-$contact.id')" 
-               onmouseout="t$contact.id=setTimeout('closeMenu(\'contact-photo-menu-button-$contact.id\'); closeMenu(\'contact-photo-menu-$contact.id\');',200)" >
-
-                       <a href="$contact.url" title="$contact.img_hover" /><img src="$contact.thumb" $contact.sparkle alt="$contact.name" /></a>
-
-                       {{ if $contact.photo_menu }}
-                       <span onclick="openClose('contact-photo-menu-$contact.id');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-$contact.id">menu</span>
-                <div class="contact-photo-menu" id="contact-photo-menu-$contact.id">
-                    <ul>
-                        $contact.photo_menu
-                    </ul>
-                </div>
-                       {{ endif }}
-               </div>
-                       
-       </div>
-       <div class="contact-entry-photo-end" ></div>
-               <div class="contact-entry-name" id="contact-entry-name-$contact.id" >$contact.name</div>
-
-       <div class="contact-entry-end" ></div>
-</div>