update date display in comment to grab UTC time from the reddit api
This commit is contained in:
parent
5181dcaeea
commit
b712dbac7c
2
TODO.md
2
TODO.md
|
@ -23,3 +23,5 @@ Known TODO's and FIXME's
|
|||
Password, perhaps color options, etc. choices about what to use to
|
||||
parse the config files, what syntax it should use, what it should
|
||||
support, etc. should be considered.
|
||||
|
||||
Fix issue with & displaying as & in link or comment text
|
||||
|
|
|
@ -154,7 +154,7 @@ typedef struct RedditLink {
|
|||
int numComments;
|
||||
int numReports;
|
||||
|
||||
char *created; // Date that this comment was created
|
||||
char *created_utc; // Date that this comment was created in UTC
|
||||
|
||||
unsigned int flags;
|
||||
unsigned int advance;
|
||||
|
@ -245,7 +245,7 @@ typedef struct RedditComment {
|
|||
char *childrenId;
|
||||
char **directChildrenIds;
|
||||
|
||||
char *created; // Date that this comment was created
|
||||
char *created_utc; // Date that this comment was created in UTC
|
||||
|
||||
unsigned int flags;
|
||||
int advance;
|
||||
|
|
|
@ -288,7 +288,7 @@ RedditComment *redditGetComment(TokenParser *parser, RedditCommentList *list)
|
|||
ADD_TOKEN_IDENT_BOOL ("edited", comment->flags, REDDIT_COMMENT_EDITED),
|
||||
ADD_TOKEN_IDENT_BOOL ("score_hidden", comment->flags, REDDIT_COMMENT_SCORE_HIDDEN),
|
||||
ADD_TOKEN_IDENT_BOOL ("distinguished", comment->flags, REDDIT_COMMENT_DISTINGUISHED),
|
||||
ADD_TOKEN_IDENT_DATE ("created", comment->created),
|
||||
ADD_TOKEN_IDENT_DATE ("created_utc", comment->created_utc),
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ RedditLink *redditGetLink(TokenParser *parser)
|
|||
ADD_TOKEN_IDENT_BOOL ("edited", link->flags, REDDIT_LINK_EDITED),
|
||||
ADD_TOKEN_IDENT_BOOL ("hidden", link->flags, REDDIT_LINK_HIDDEN),
|
||||
ADD_TOKEN_IDENT_BOOL ("distinguished", link->flags, REDDIT_LINK_DISTINGUISHED),
|
||||
ADD_TOKEN_IDENT_DATE ("created", link->created),
|
||||
ADD_TOKEN_IDENT_DATE ("created_utc", link->created_utc),
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ void parseTokens (TokenParser *parser, TokenIdent *identifiers, ...);
|
|||
.value = &(member)}
|
||||
|
||||
/*
|
||||
* A specific token for getting the date from the 'created' JSON API object
|
||||
* A specific token for getting the date from the 'created_utc' JSON API object
|
||||
*/
|
||||
#define ADD_TOKEN_IDENT_DATE(key_name, member) \
|
||||
{.name = key_name, \
|
||||
|
|
|
@ -377,7 +377,7 @@ void commentScreenDisplay(CommentScreen *screen)
|
|||
if (screen->lineCount >= screen->selected) {
|
||||
current = screen->lines[screen->selected]->comment;
|
||||
if (current != NULL) {
|
||||
swprintf(tmpbuf, bufLen, L"%s - %d Up / %d Down - %s", current->author, current->ups, current->downs, current->created);
|
||||
swprintf(tmpbuf, bufLen, L"%s - %d Up / %d Down - %s", current->author, current->ups, current->downs, current->created_utc);
|
||||
mvaddwstr(lastLine + 1, 0, tmpbuf);
|
||||
swprintf(tmpbuf, bufLen, L"-------");
|
||||
mvaddwstr(lastLine + 2, 0, tmpbuf);
|
||||
|
@ -553,7 +553,7 @@ void linkScreenRenderLinkText (LinkScreen *screen, wchar_t *tmpbuf, int bufLen,
|
|||
if (screen->list->linkCount >= screen->selected) {
|
||||
current = screen->list->links[screen->selected];
|
||||
if (current != NULL) {
|
||||
swprintf(tmpbuf, bufLen, L"%s - %d Score / %d Up / %d Down / %d Comments / %s \nTitle: ", current->author, current->score, current->ups, current->downs, current->numComments, current->created);
|
||||
swprintf(tmpbuf, bufLen, L"%s - %d Score / %d Up / %d Down / %d Comments / %s \nTitle: ", current->author, current->score, current->ups, current->downs, current->numComments, current->created_utc);
|
||||
mvaddwstr(lastLine + 1, 0, tmpbuf);
|
||||
addwstr(current->wtitleEsc);
|
||||
addch('\n');
|
||||
|
|
Loading…
Reference in New Issue