]> git.mxchange.org Git - friendica.git/commitdiff
Don't auto mention yourself or forums, don't do it in the firstlevel post
authorMichael <heluecht@pirati.ca>
Wed, 30 Jan 2019 03:36:24 +0000 (03:36 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 30 Jan 2019 03:36:24 +0000 (03:36 +0000)
src/Object/Post.php
view/templates/comment_item.tpl
view/theme/duepuntozero/templates/comment_item.tpl
view/theme/quattro/templates/comment_item.tpl
view/theme/vier/templates/comment_item.tpl

index 3ac5c77ee9545a46674bc4dacd88242688e541ef..bc1123db2b1af845e6a98a915c4c773cee5221a6 100644 (file)
@@ -775,19 +775,26 @@ class Post extends BaseObject
         */
        private function getDefaultText()
        {
+               $a = self::getApp();
+
                $item = Item::selectFirst(['author-addr'], ['id' => $this->getId()]);
                if (!DBA::isResult($item) || empty($item['author-addr'])) {
                        // Should not happen
                        return '';
                }
 
-               $text = '@' . $item['author-addr'] . ' ';
+               if ($item['author-addr'] != $a->profile['addr']) {
+                       $text = '@' . $item['author-addr'] . ' ';
+               } else {
+                       $text = '';
+               }
 
                $terms = Term::tagArrayFromItemId($this->getId(), TERM_MENTION);
 
                foreach ($terms as $term) {
                        $profile = Contact::getDetailsByURL($term['url']);
-                       if (!empty($profile['addr']) && !strstr($text, $profile['addr'])) {
+                       if (!empty($profile['addr']) && ($profile['contact-type'] != Contact::TYPE_COMMUNITY) &&
+                               ($profile['addr'] != $a->profile['addr']) && !strstr($text, $profile['addr'])) {
                                $text .= '@' . $profile['addr'] . ' ';
                        }
                }
index 9412b681ebf55afb2bd0f547f00b16d47a19127b..352ff417f0e01ab9812498e5a6165b7dbc26d807 100644 (file)
@@ -17,7 +17,7 @@
                                        <a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
                                </div>
                                <div class="comment-edit-photo-end"></div>
-                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});" onBlur="commentClose(this,{{$id}});">{{$default}}</textarea>
+                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});" onBlur="commentClose(this,{{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
                                {{if $qcomment}}
                                        <select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});" >
                                        <option value=""></option>
index e6d81ac2bd69f2a2a2b3edb0f74015bcaa96c380..bfa5f093884d5cce04866eee21c2abc4bfb9c242 100644 (file)
@@ -44,7 +44,7 @@
                                                data-role="insert-formatting" data-bbcode="video" data-id="{{$id}}"></a></li>
                                </ul>
                                <div class="comment-edit-bb-end"></div>
-                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen(this, {{$id}});" onBlur="commentClose(this,{{$id}});cmtBbClose(this,{{$id}});">{{$default}}</textarea>
+                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen(this, {{$id}});" onBlur="commentClose(this,{{$id}});cmtBbClose(this,{{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
                                {{if $qcomment}}
                                        <select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
                                        <option value=""></option>
index f1365035a473205fd300e4a6f0c0733bc0249dd1..774ffac2757e887a511a6ba6ad181b40f42cb71f 100644 (file)
@@ -42,7 +42,7 @@
                                        class="comment-edit-text-empty"
                                        name="body"
                                        placeholder="{{$comment}}"
-                                       onFocus="commentOpen(this,{{$id}}) && cmtBbOpen({{$id}});">{{$default}}</textarea>
+                                       onFocus="commentOpen(this,{{$id}}) && cmtBbOpen({{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
                                {{if $qcomment}}
                                        <select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
                                        <option value=""></option>
index 4ef31b7af807fe49393088a3ccedda1e325fe581..8ccdccb80d2878f17e9e9d8ab395ec11e3864e11 100644 (file)
@@ -17,7 +17,7 @@
                                        <a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
                                </div>
                                <div class="comment-edit-photo-end"></div>
-                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});">{{$default}}</textarea>
+                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
                                {{if $qcomment}}
                                        <select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
                                        <option value=""></option>