use of com.ushahidi.android.app.api.CommentsApi in project Ushahidi_Android by ushahidi.
the class FetchReportsComments method fetchReportComments.
private void fetchReportComments(Bundle bundle) {
if (bundle != null) {
int reportid = bundle.getInt("reportid");
status = new CommentsApi().saveComments(reportid) ? 0 : 99;
}
}
use of com.ushahidi.android.app.api.CommentsApi in project Ushahidi_Android by ushahidi.
the class UploadComments method addComments.
private int addComments(Bundle bundle) {
CommentFields comment = new CommentFields();
CommentsApi commentApi = new CommentsApi();
if (bundle != null) {
Comment c = new Comment();
c.setAuthor(bundle.getString("comment_author"));
c.setDescription(bundle.getString("comment_description"));
c.setReportId(bundle.getInt("report_id"));
comment.fill(c);
comment.setEmail(bundle.getString("comment_email"));
Response response = commentApi.submit(comment);
if (response != null) {
if (response.getErrorCode() == 0) {
commentApi.saveComments(bundle.getInt("report_id"));
}
}
}
return 1;
}
Aggregations