1DriveComment = function(file, id, content, modifiedDate, createdDate, isResolved, user, pCommentId)
2{
3	DrawioComment.call(this, file, id, content, modifiedDate, createdDate, isResolved, user);
4	this.pCommentId = pCommentId; //a reply
5};
6
7//Extends DrawioComment
8mxUtils.extend(DriveComment, DrawioComment);
9
10DriveComment.prototype.addReply = function(reply, success, error, doResolve, doReopen)
11{
12	var body = {'content': reply.content};
13
14	if (doResolve)
15	{
16		body.verb = 'resolve';
17	}
18	else if (doReopen)
19	{
20		body.verb = 'reopen';
21	}
22
23	this.file.ui.drive.executeRequest(
24		{
25			url: '/files/' + this.file.getId() + '/comments/' + this.id + '/replies',
26			params: body,
27			method: 'POST'
28		},
29		mxUtils.bind(this, function(resp)
30		{
31			success(resp.replyId); //pass comment id
32		}), error);
33};
34
35DriveComment.prototype.editComment = function(newContent, success, error)
36{
37	this.content = newContent;
38	var body = {'content': newContent};
39
40	this.file.ui.drive.executeRequest(
41		this.pCommentId?
42		{
43			url: '/files/' + this.file.getId() + '/comments/' + this.pCommentId + '/replies/' + this.id,
44			params: body,
45			method: 'PATCH'
46		} :
47		{
48			url: '/files/' + this.file.getId() + '/comments/' + this.id,
49			params: body,
50			method: 'PATCH'
51		},
52	success, error);
53};
54
55DriveComment.prototype.deleteComment = function(success, error)
56{
57	this.file.ui.drive.executeRequest(
58		this.pCommentId?
59		{
60			url: '/files/' + this.file.getId() + '/comments/' + this.pCommentId + '/replies/' + this.id,
61			method: 'DELETE'
62		}:
63		{
64			url: '/files/' + this.file.getId() + '/comments/' + this.id,
65			method: 'DELETE'
66		},
67	success, error);
68};
69