[bugzilla-gnome-org-extensions] Add Review.Comment.getInReplyTo()



commit b944dce41e9978c5ccc80a9378866bcc4711ffd3
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Oct 4 17:12:09 2009 -0400

    Add Review.Comment.getInReplyTo()
    
    Add a function to determine if a review comment looks like it is
    a reply to a comment from another review.

 js/review.js |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/js/review.js b/js/review.js
index 913a4aa..144ea7e 100644
--- a/js/review.js
+++ b/js/review.js
@@ -27,6 +27,20 @@ Comment.prototype = {
         return this.file.patchFile.getHunk(this.location);
     },
 
+    getInReplyTo : function() {
+        var hunk = this.getHunk();
+        var line = hunk.lines[this.location - hunk.location];
+        for (var i = 0; i < line.reviewComments.length; i++) {
+            var comment = line.reviewComments[0];
+            if (comment === this)
+                return null;
+            if (comment.type == this.type)
+                return comment;
+        }
+
+        return null;
+    },
+
     remove : function() {
         var hunk = this.getHunk();
         var line = hunk.lines[this.location - hunk.location];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]