Commit d7b4aac1 authored by Dries's avatar Dries
Browse files

- By default, nodes posted through the bloggerapi.module will have

  read/write comments.  Patch by Mark Cornick, approved by Greg Tyrelly.
parent 75d4c15f
......@@ -35,7 +35,7 @@ function bloggerapi_newPost($params) {
if (node_access("create", $node)) {
throttle("node", variable_get("max_node_rate", 900));
$fields = array("uid" => $user->uid, "comment" => 1, "promote", "moderate", "status" => 1, "teaser", "title", "type" => $node->type, "body");
$fields = array("uid" => $user->uid, "comment" => 2, "promote", "moderate", "status" => 1, "teaser", "title", "type" => $node->type, "body");
$nid = node_save($node, array_merge($fields, module_invoke($node->type, "save", "create", $node)));
if ($nid) {
watchdog("special", "$node->type: added '$node->title', via Blogger API");
......@@ -55,7 +55,7 @@ function bloggerapi_editPost($params) {
$node = node_validate(bloggerapi_driver("editPost", $params, $error), $error);
if (!$node->error) {
$filter = array("nid" => $node->nid, "uid" => $user->uid, "comment" => 1, "promote", "moderate", "status" => 1, "teaser", "title", "type" => $node->type, "body");
$filter = array("nid" => $node->nid, "uid" => $user->uid, "comment" => 2, "promote", "moderate", "status" => 1, "teaser", "title", "type" => $node->type, "body");
$nid = node_save($node, array_merge($filter, module_invoke($node->type, "save", "update", $node)));
if ($nid) {
watchdog("special", "$node->type: updated '$node->title', via Blogger API");
......@@ -174,12 +174,12 @@ function bloggerapi_driver($method, $params = 0, $error = 0) {
switch ($method) {
case "newPost":
return array("type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 1, "promote" => 0, "revision" => 0);
return array("type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
break;
case "editPost":
$node = node_load(array("nid" => $cparams[1]));
if ($node->uid == $user->uid) {
return array("nid" => $cparams[1], "type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 1, "promote" => 0, "revision" => 0);
return array("nid" => $cparams[1], "type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
} else {
return bloggerapi_error("Error updating node");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment