Add 'Flag' link for comments.
540884
public function DiscussionController_InsideCommentMeta_Handler($Sender, $Args) {      
      // Signed in users only. No guest reporting!
      if (Gdn::Session()->UserID)
         $this->AddFlagButton($Sender, $Args);
   }
643486
def set_comment(self, key_name, new_comment):
        """"""
        kf = self.dct[key_name]
        kf['comment'] = new_comment
787332
def name_for_comment(comment)
      if comment.website?
        link_to(comment.name, comment.website, class: "blogit_comment__name_link")
      else
        comment.name
      end + " " + t('wrote', scope: "blogit.comments")
    end
284418
def addcomment(self, order_increment_id,
            status, comment=None, notify=False):
        
        if comment is None:
            comment = ""
        return bool(self.call(
                'sales_order.addComment',
                [order_increment_id, status, comment, notify]
            )
        )
115159
def comment(self, comment, show=False, endline=True, newpar=False):
        """"""
        if not endline:
            comment += "<NOBR>"
        if newpar:
            comment += "<BR>"
        self._write("comment:%d:%s\n" % (int(show), comment))
        return self
907736
def add_comment(self, comment):
        
        if not comment:
            return

        self.__comments[comment.name] = comment
        self.comment_added_signal(self, comment)
44852
def match_comment(self):
        """"""
        match = self.match(r"<%doc>(.*?)</%doc>", re.S)
        if match:
            self.append_node(parsetree.Comment, match.group(1))
            return True
        else:
            return False
120115
public function updateComment()
    {
        $newComment = $_POST['comment'] ?? null;
        $commentId = $_POST['commentId'] ?? null;

        if (!$newComment || !$commentId || !$comment = get_comment($commentId)) {
            wp_send_json_error('Missing variables');
        }

        if (!current_user_can('edit_comment', $comment->comment_ID) && !($comment->user_id == get_current_user_id())) {
            wp_send_json_error('Missing authorization');
        }

        // Validate nonce
        if (!check_ajax_referer("update-comment_$comment->comment_ID", 'nonce', false)) {
            wp_send_json_error('Nonce failed');
        }

        $comment->comment_content = $newComment;
        if (wp_update_comment((array) $comment)) {
            wp_send_json_success('Update was successful');
        }

        wp_send_json();
    }
1198711
def _add_comments(self, comments, original_string=""):
        
        return comments and "{0}  # {1}".format(self._strip_comments(original_string)[0],
                                                "; ".join(comments)) or original_string
1119305
def addComment(self, msg=None):
        

        origin_comment = '''
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rtc_ext="http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/"
    xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"
    xmlns:oslc_cm="http://open-services.net/ns/cm#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc_cmx="http://open-services.net/ns/cm-x#"
    xmlns:oslc="http://open-services.net/ns/core#">
  <rdf:Description rdf:about="{0}">
    <rdf:type rdf:resource="http://open-services.net/ns/core#Comment"/>
    <dcterms:description rdf:parseType="Literal">{1}</dcterms:description>
  </rdf:Description>
</rdf:RDF>
'''

        comments_url = "/".join([self.url,
                                 "rtc_cm:comments"])
        headers = copy.deepcopy(self.rtc_obj.headers)
        resp = self.get(comments_url,
                        verify=False,
                        proxies=self.rtc_obj.proxies,
                        headers=headers)

        raw_data = xmltodict.parse(resp.content)

        total_cnt = raw_data["oslc_cm:Collection"]["@oslc_cm:totalCount"]
        comment_url = "/".join([comments_url,
                                total_cnt])

        comment_msg = origin_comment.format(comment_url, msg)

        headers["Content-Type"] = self.OSLC_CR_RDF
        headers["Accept"] = self.OSLC_CR_RDF
        headers["OSLC-Core-Version"] = "2.0"
        headers["If-Match"] = resp.headers.get("etag")
        req_url = "/".join([comments_url,
                            "oslc:comment"])

        resp = self.post(req_url,
                         verify=False,
                         headers=headers,
                         proxies=self.rtc_obj.proxies,
                         data=comment_msg)
        self.log.info("Successfully add comment: [%s] for <Workitem %s>",
                      msg, self)

        raw_data = xmltodict.parse(resp.content)
        return Comment(comment_url,
                       self.rtc_obj,
                       raw_data=raw_data["rdf:RDF"]["rdf:Description"])
120073
def issue_add_comment(self, issue_key, comment, visibility=None):
        
        url = 'rest/api/2/issue/{issueIdOrKey}/comment'.format(issueIdOrKey=issue_key)
        data = {'body': comment}
        if visibility:
            data['visibility'] = visibility
        return self.post(url, data=data)
765433
def serialize_comment(ctx, document, el, root):
    ""

    # Check if option is turned on

    if el.comment_type == 'end':
        ctx.opened_comments.remove(el.cid)
    else:
        if el.comment_type != 'reference':
            ctx.opened_comments.append(el.cid)

        if ctx.options['comment_span']:
            link = etree.SubElement(root, 'a')
            link.set('href', '#')
            link.set('class', 'comment-link')    
            link.set('id', 'comment-id-' + el.cid)    

            link.text = ''

            fire_hooks(ctx, document, el, link, ctx.get_hook('comment'))

    return root
1017812
function addFlags(mask, flags) {
    if (flags.onlydir) mask = mask | Inotify.IN_ONLYDIR;
    if (flags.dont_follow) mask = mask | Inotify.IN_DONT_FOLLOW;
    if (flags.oneshot) mask = mask | Inotify.IN_ONESHOT;
    return mask;
}
683253
public function set_comments_highlighting($key, $flag = true) {
        $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false;
    }
755546
public void addComment(Comment comment) {
        if (comments == null || comments.size() == 0) {
            comments = new ArrayList<Comment>();
        }

        comments.add((CommentImpl) comment);
    }
1077010
def create_comment(self, text):
        
        return DashboardComment.get_or_create(self._issue_or_pr, self._header, text)
660131
def perform_flag(request, comment):
    
    flag, created = comments.models.CommentFlag.objects.get_or_create(
        comment = comment,
        user    = request.user,
        flag    = comments.models.CommentFlag.SUGGEST_REMOVAL
    )
    signals.comment_was_flagged.send(
        sender  = comment.__class__,
        comment = comment,
        flag    = flag,
        created = created,
        request = request,
    )