Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- fixed "comments disabled" bug #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions JoeBlogs/Mapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ internal static XmlRpcPost Post(Post input)
postid = input.PostID,
title = input.Title,
permaLink = input.Permalink,
wp_slug = input.Slug,
post_type = input.PostType,
mt_allow_comments = input.CommentsEnabled ? "open" : "closed",
custom_fields = input.CustomFields == null ? null : input.CustomFields.Select(cf => new XmlRpcCustomField()
{
id = cf.ID,
Expand Down
7 changes: 5 additions & 2 deletions JoeBlogs/classes/Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public class Post
{
public Post()
{
DateCreated = DateTime
.Now;
DateCreated = DateTime.Now;
CommentsEnabled = true;
}

public int PostID { get; set; }
Expand All @@ -21,6 +21,9 @@ public Post()
public CustomField[] CustomFields { get; set; }
public Term[] Terms { get; set; }
public string PostType { get; set; }
public bool CommentsEnabled { get; set; }
public string Slug { get; set; }


public override string ToString()
{
Expand Down
2 changes: 1 addition & 1 deletion JoeBlogs/xmlRpcStructs/Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public struct XmlRpcPost
public string mt_excerpt;
public string mt_text_more;
public string wp_more_text;
public int mt_allow_comments;
public string mt_allow_comments;
public int mt_allow_pings;
public string mt_keywords;
public string wp_slug;
Expand Down