Fix bug with 'L' key not working. Fix up/down to just report score

This commit is contained in:
stoicism2323 2016-07-23 13:49:21 -07:00
parent c8f6ce816b
commit 5aea848c68
4 changed files with 10 additions and 5 deletions

View File

@ -194,6 +194,7 @@ typedef struct RedditLinkList {
int linkCount;
RedditLink **links;
char *afterId;
} RedditLinkList;
/*

View File

@ -82,6 +82,7 @@ EXPORT_SYMBOL void redditLinkListFree (RedditLinkList *list)
redditLinkListFreeLinks(list);
free(list->subreddit);
free(list->modhash);
free(list->afterId);
free(list);
}
@ -148,7 +149,7 @@ DEF_TOKEN_CALLBACK(getListingHelper)
ARG_LIST_GET_LISTING
/* Search for the 'kink' ident, and check if it was set to 't3' */
/* Search for the 'kind' ident, and check if it was set to 't3' */
int i;
for (i = 0; idents[i].name != NULL; i++)
if (strcmp(idents[i].name, "kind") == 0)
@ -172,6 +173,7 @@ EXPORT_SYMBOL RedditErrno redditGetListing (RedditLinkList *list)
ADD_TOKEN_IDENT_STRING("modhash", list->modhash),
ADD_TOKEN_IDENT_STRING("kind", kindStr),
ADD_TOKEN_IDENT_FUNC ("data", getListingHelper),
ADD_TOKEN_IDENT_STRING("after", list->afterId),
{0}
};
@ -191,7 +193,7 @@ EXPORT_SYMBOL RedditErrno redditGetListing (RedditLinkList *list)
strcat(subred, REDDIT_JSON);
if (list->linkCount > 0)
sprintf(subred + strlen(subred), "?after=t3_%s", list->links[list->linkCount - 1]->id);
sprintf(subred + strlen(subred), "?after=%s", list->afterId);
res = redditRunParser(subred, NULL, ids, list);

View File

@ -311,8 +311,10 @@ void vparseTokens (TokenParser *p, TokenIdent *identifiers, va_list args)
continue;
for (i = 0; i < identCount; i++)
if (performIdentAction(p, identifiers, i, args))
if (performIdentAction(p, identifiers, i, args)) {
(p->currentToken)--;
break;
}
}

View File

@ -400,7 +400,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_utc);
swprintf(tmpbuf, bufLen, L"%s - %d Score - %s", current->author, current->ups, current->created_utc);
mvaddwstr(lastLine + 1, 0, tmpbuf);
swprintf(tmpbuf, bufLen, L"-------");
mvaddwstr(lastLine + 2, 0, tmpbuf);
@ -576,7 +576,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_utc);
swprintf(tmpbuf, bufLen, L"%s - %d Score / %d Comments / %s \nTitle: ", current->author, current->score, current->numComments, current->created_utc);
mvaddwstr(lastLine + 1, 0, tmpbuf);
addwstr(current->wtitleEsc);
addch('\n');