Change return values
FossilOrigin-Name: 131439963d2dbece2340d41df2180ebe6546280fe0aece649510e8f404135dc0
This commit is contained in:
parent
7124bb35ca
commit
d271e103c4
31 changed files with 119 additions and 116 deletions
|
@ -20,7 +20,7 @@
|
|||
#include "base_page.h"
|
||||
#include "about.h"
|
||||
|
||||
void content_about(PATH_ARGS)
|
||||
int content_about(PATH_ARGS)
|
||||
{
|
||||
PERL_STACK_INIT;
|
||||
HV* session_hv = perlify_session(ssn);
|
||||
|
@ -42,7 +42,7 @@ void content_about(PATH_ARGS)
|
|||
}
|
||||
|
||||
|
||||
void content_about_license(PATH_ARGS)
|
||||
int content_about_license(PATH_ARGS)
|
||||
{
|
||||
PERL_STACK_INIT;
|
||||
HV* session_hv = perlify_session(ssn);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "session.h"
|
||||
#include "path.h"
|
||||
|
||||
void content_about_license(PATH_ARGS);
|
||||
void content_about(PATH_ARGS);
|
||||
int content_about_license(PATH_ARGS);
|
||||
int content_about(PATH_ARGS);
|
||||
|
||||
#endif /* ABOUT_H */
|
||||
|
|
|
@ -286,7 +286,7 @@ static void fetch_account_page(FCGX_Request* req,
|
|||
tb_free(data);
|
||||
}
|
||||
|
||||
void content_account_statuses(PATH_ARGS)
|
||||
int content_account_statuses(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_account_statuses_args args = {
|
||||
.pinned = 0,
|
||||
|
@ -305,22 +305,22 @@ void content_account_statuses(PATH_ARGS)
|
|||
fetch_account_page(req, ssn, api, data[0], &args, ACCT_TAB_STATUSES, account_statuses_cb);
|
||||
}
|
||||
|
||||
void content_account_followers(PATH_ARGS)
|
||||
int content_account_followers(PATH_ARGS)
|
||||
{
|
||||
fetch_account_page(req, ssn, api, data[0], NULL, ACCT_TAB_NONE, account_followers_cb);
|
||||
}
|
||||
|
||||
void content_account_following(PATH_ARGS)
|
||||
int content_account_following(PATH_ARGS)
|
||||
{
|
||||
fetch_account_page(req, ssn, api, data[0], NULL, ACCT_TAB_NONE, account_following_cb);
|
||||
}
|
||||
|
||||
void content_account_scrobbles(PATH_ARGS)
|
||||
int content_account_scrobbles(PATH_ARGS)
|
||||
{
|
||||
fetch_account_page(req, ssn, api, data[0], NULL, ACCT_TAB_SCROBBLES, account_scrobbles_cb);
|
||||
}
|
||||
|
||||
void content_account_pinned(PATH_ARGS)
|
||||
int content_account_pinned(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_account_statuses_args args = {
|
||||
.pinned = 1,
|
||||
|
@ -339,7 +339,7 @@ void content_account_pinned(PATH_ARGS)
|
|||
fetch_account_page(req, ssn, api, data[0], &args, ACCT_TAB_PINNED, account_statuses_cb);
|
||||
}
|
||||
|
||||
void content_account_media(PATH_ARGS)
|
||||
int content_account_media(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_account_statuses_args args = {
|
||||
.pinned = 0,
|
||||
|
@ -358,7 +358,7 @@ void content_account_media(PATH_ARGS)
|
|||
fetch_account_page(req, ssn, api, data[0], &args, ACCT_TAB_MEDIA, account_statuses_cb);
|
||||
}
|
||||
|
||||
void content_account_action(PATH_ARGS)
|
||||
int content_account_action(PATH_ARGS)
|
||||
{
|
||||
char* referer = GET_ENV("HTTP_REFERER", req);
|
||||
struct mstdnt_storage storage = { 0 };
|
||||
|
@ -388,7 +388,7 @@ void content_account_action(PATH_ARGS)
|
|||
redirect(req, REDIRECT_303, referer);
|
||||
}
|
||||
|
||||
void content_account_bookmarks(PATH_ARGS)
|
||||
int content_account_bookmarks(PATH_ARGS)
|
||||
{
|
||||
size_t statuses_len = 0;
|
||||
struct mstdnt_status* statuses = NULL;
|
||||
|
@ -407,7 +407,7 @@ void content_account_bookmarks(PATH_ARGS)
|
|||
content_timeline(req, ssn, api, &storage, statuses, statuses_len, BASE_CAT_BOOKMARKS, "Bookmarks", 0, 1);
|
||||
}
|
||||
|
||||
void content_account_blocked(PATH_ARGS)
|
||||
int content_account_blocked(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_account_args args = {
|
||||
.max_id = keystr(ssn->post.max_id),
|
||||
|
@ -439,7 +439,7 @@ void content_account_blocked(PATH_ARGS)
|
|||
tb_free(result);
|
||||
}
|
||||
|
||||
void content_account_muted(PATH_ARGS)
|
||||
int content_account_muted(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_account_args args = {
|
||||
.max_id = keystr(ssn->post.max_id),
|
||||
|
@ -471,7 +471,7 @@ void content_account_muted(PATH_ARGS)
|
|||
tb_free(result);
|
||||
}
|
||||
|
||||
void content_account_favourites(PATH_ARGS)
|
||||
int content_account_favourites(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
|
|
@ -58,17 +58,17 @@ struct account_page
|
|||
|
||||
void get_account_info(mastodont_t* api, struct session* ssn);
|
||||
|
||||
void content_account_followers(PATH_ARGS);
|
||||
void content_account_following(PATH_ARGS);
|
||||
void content_account_statuses(PATH_ARGS);
|
||||
void content_account_scrobbles(PATH_ARGS);
|
||||
void content_account_pinned(PATH_ARGS);
|
||||
void content_account_blocked(PATH_ARGS);
|
||||
void content_account_muted(PATH_ARGS);
|
||||
void content_account_media(PATH_ARGS);
|
||||
void content_account_action(PATH_ARGS);
|
||||
void content_account_favourites(PATH_ARGS);
|
||||
void content_account_bookmarks(PATH_ARGS);
|
||||
int content_account_followers(PATH_ARGS);
|
||||
int content_account_following(PATH_ARGS);
|
||||
int content_account_statuses(PATH_ARGS);
|
||||
int content_account_scrobbles(PATH_ARGS);
|
||||
int content_account_pinned(PATH_ARGS);
|
||||
int content_account_blocked(PATH_ARGS);
|
||||
int content_account_muted(PATH_ARGS);
|
||||
int content_account_media(PATH_ARGS);
|
||||
int content_account_action(PATH_ARGS);
|
||||
int content_account_favourites(PATH_ARGS);
|
||||
int content_account_bookmarks(PATH_ARGS);
|
||||
|
||||
HV* perlify_account(const struct mstdnt_account* acct);
|
||||
AV* perlify_accounts(const struct mstdnt_account* accounts, size_t len);
|
||||
|
|
|
@ -134,7 +134,7 @@ HV* perlify_attachment(const struct mstdnt_attachment* const attachment)
|
|||
|
||||
PERLIFY_MULTI(attachment, attachments, mstdnt_attachment)
|
||||
|
||||
void api_attachment_create(PATH_ARGS)
|
||||
int api_attachment_create(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_storage *att_storage = NULL;
|
||||
struct mstdnt_attachment* attachments = NULL;
|
||||
|
|
|
@ -34,7 +34,7 @@ int try_upload_media(struct mstdnt_storage** storage,
|
|||
char*** media_ids);
|
||||
void cleanup_media_storages(struct session* ssn, struct mstdnt_storage* storage);
|
||||
void cleanup_media_ids(struct session* ssn, char** media_ids);
|
||||
void api_attachment_create(PATH_ARGS);
|
||||
int api_attachment_create(PATH_ARGS);
|
||||
|
||||
// Perl
|
||||
HV* perlify_attachment(const struct mstdnt_attachment* const attachment);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "error.h"
|
||||
#include "base_page.h"
|
||||
|
||||
void content_chats(PATH_ARGS)
|
||||
int content_chats(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -74,7 +74,7 @@ void content_chats(PATH_ARGS)
|
|||
tb_free(dup);
|
||||
}
|
||||
|
||||
void content_chat_view(PATH_ARGS)
|
||||
int content_chat_view(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#include <mastodont.h>
|
||||
#include "session.h"
|
||||
|
||||
void content_chats(PATH_ARGS);
|
||||
void content_chat_view(PATH_ARGS);
|
||||
int content_chats(PATH_ARGS);
|
||||
int content_chat_view(PATH_ARGS);
|
||||
|
||||
AV* perlify_chats(const struct mstdnt_chat* chats, size_t chats_len);
|
||||
HV* perlify_chat(const struct mstdnt_chat* chat);
|
||||
|
|
|
@ -66,7 +66,7 @@ static char* construct_emoji_voidwrap(void* passed, size_t index, size_t* res)
|
|||
|
||||
#define EMOJI_PICKER_ARGS(this_index) { .status_id = status_id, .index = this_index }
|
||||
|
||||
void content_emoji_picker(PATH_ARGS)
|
||||
int content_emoji_picker(PATH_ARGS)
|
||||
{
|
||||
char* picker = construct_emoji_picker(NULL, NULL);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ enum emoji_picker_cat
|
|||
};
|
||||
|
||||
char* construct_emoji(struct emoji_info* emoji, char* status_id, size_t* size);
|
||||
void content_emoji_picker(PATH_ARGS);
|
||||
int content_emoji_picker(PATH_ARGS);
|
||||
char* construct_emoji_picker(char* status_id, size_t* size);
|
||||
|
||||
// Perl
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <stdlib.h>
|
||||
#include "timeline.h"
|
||||
|
||||
void content_index(FCGX_Request* req, struct session* ssn, mastodont_t* api)
|
||||
int content_index(FCGX_Request* req, struct session* ssn, mastodont_t* api)
|
||||
{
|
||||
// Check logins
|
||||
content_tl_home(req, ssn, api, NULL);
|
||||
|
|
|
@ -21,6 +21,6 @@
|
|||
#include <mastodont.h>
|
||||
#include "session.h"
|
||||
|
||||
void content_index(FCGX_Request* req, struct session* ssn, mastodont_t* api);
|
||||
int content_index(FCGX_Request* req, struct session* ssn, mastodont_t* api);
|
||||
|
||||
#endif // INDEX_H
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "string_helpers.h"
|
||||
#include "http.h"
|
||||
|
||||
void content_lists(PATH_ARGS)
|
||||
int content_lists(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -79,7 +79,7 @@ void content_lists(PATH_ARGS)
|
|||
tb_free(dup);
|
||||
}
|
||||
|
||||
void list_edit(PATH_ARGS)
|
||||
int list_edit(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#include "session.h"
|
||||
|
||||
/** Creates the main lists view */
|
||||
void content_lists(PATH_ARGS);
|
||||
int content_lists(PATH_ARGS);
|
||||
/** Creates a list and then redirects */
|
||||
void list_edit(PATH_ARGS);
|
||||
int list_edit(PATH_ARGS);
|
||||
|
||||
/** Converts list to perl hash */
|
||||
HV* perlify_list(const struct mstdnt_list* list);
|
||||
|
|
|
@ -41,7 +41,7 @@ static void apply_access_token(REQUEST_T req, char* token)
|
|||
config_url_prefix[0] != '\0' ? config_url_prefix : "/");
|
||||
}
|
||||
|
||||
void content_login_oauth(PATH_ARGS)
|
||||
int content_login_oauth(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -123,7 +123,7 @@ void content_login_oauth(PATH_ARGS)
|
|||
if (decode_url) curl_free(decode_url);
|
||||
}
|
||||
|
||||
void content_login(PATH_ARGS)
|
||||
int content_login(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "session.h"
|
||||
#include "path.h"
|
||||
|
||||
void content_login_oauth(PATH_ARGS);
|
||||
void content_login(PATH_ARGS);
|
||||
int content_login_oauth(PATH_ARGS);
|
||||
int content_login(PATH_ARGS);
|
||||
|
||||
#endif // LOGIN_H
|
||||
|
|
12
src/main.c
12
src/main.c
|
@ -53,7 +53,7 @@ void boot_DynaLoader (pTHX_ CV* cv);
|
|||
|
||||
#ifdef DEBUG
|
||||
static int quit = 0;
|
||||
static void exit_treebird(PATH_ARGS)
|
||||
static int exit_treebird(PATH_ARGS)
|
||||
{
|
||||
quit = 1;
|
||||
exit(1);
|
||||
|
@ -127,8 +127,9 @@ static struct path_info paths[] = {
|
|||
{ "/treebird_api/v1/attachment", api_attachment_create },
|
||||
};
|
||||
|
||||
static void application(mastodont_t* api, REQUEST_T req)
|
||||
static int application(mastodont_t* api, REQUEST_T req)
|
||||
{
|
||||
int rc;
|
||||
propagate_memory();
|
||||
|
||||
// Default config
|
||||
|
@ -175,7 +176,7 @@ static void application(mastodont_t* api, REQUEST_T req)
|
|||
// Load current account information
|
||||
get_account_info(api, &ssn);
|
||||
|
||||
handle_paths(req, &ssn, api, paths, sizeof(paths)/sizeof(paths[0]));
|
||||
rc = handle_paths(req, &ssn, api, paths, sizeof(paths)/sizeof(paths[0]));
|
||||
|
||||
// Cleanup
|
||||
if (cookies_str) tb_free(cookies_str);
|
||||
|
@ -200,9 +201,10 @@ static void fcgi_start(mastodont_t* api)
|
|||
rc = FCGX_Accept_r(&req);
|
||||
if (rc < 0) break;
|
||||
|
||||
application(api, &req);
|
||||
rc = application(api, &req);
|
||||
|
||||
FCGX_Finish_r(&req);
|
||||
if (rc)
|
||||
FCGX_Finish_r(&req);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "base_page.h"
|
||||
#include "memory.h"
|
||||
|
||||
void content_memory_stats(PATH_ARGS)
|
||||
int content_memory_stats(PATH_ARGS)
|
||||
{
|
||||
PERL_STACK_INIT;
|
||||
HV* session_hv = perlify_session(ssn);
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
#include "session.h"
|
||||
#include "path.h"
|
||||
|
||||
void content_memory_stats(PATH_ARGS);
|
||||
int content_memory_stats(PATH_ARGS);
|
||||
|
||||
#endif // MEMORY_PAGE_H
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "account.h"
|
||||
#include "../config.h"
|
||||
|
||||
void content_notifications(PATH_ARGS)
|
||||
int content_notifications(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -83,7 +83,7 @@ void content_notifications(PATH_ARGS)
|
|||
tb_free(dup);
|
||||
}
|
||||
|
||||
void content_notifications_compact(PATH_ARGS)
|
||||
int content_notifications_compact(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -128,7 +128,7 @@ void content_notifications_compact(PATH_ARGS)
|
|||
tb_free(page);
|
||||
}
|
||||
|
||||
void content_notifications_clear(PATH_ARGS)
|
||||
int content_notifications_clear(PATH_ARGS)
|
||||
{
|
||||
char* referer = GET_ENV("HTTP_REFERER", req);
|
||||
struct mstdnt_args m_args;
|
||||
|
@ -147,7 +147,7 @@ void content_notifications_clear(PATH_ARGS)
|
|||
redirect(req, REDIRECT_303, referer);
|
||||
}
|
||||
|
||||
void content_notifications_read(PATH_ARGS)
|
||||
int content_notifications_read(PATH_ARGS)
|
||||
{
|
||||
char* referer = GET_ENV("HTTP_REFERER", req);
|
||||
struct mstdnt_args m_args;
|
||||
|
@ -200,7 +200,7 @@ HV* perlify_notification(const struct mstdnt_notification* const notif)
|
|||
|
||||
PERLIFY_MULTI(notification, notifications, mstdnt_notification)
|
||||
|
||||
void api_notifications(PATH_ARGS)
|
||||
int api_notifications(PATH_ARGS)
|
||||
{
|
||||
send_result(req, NULL, "application/json", "{\"status\":0}", 0);
|
||||
}
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
#include "cgi.h"
|
||||
|
||||
// Page contents
|
||||
void content_notifications(PATH_ARGS);
|
||||
void content_notifications_compact(PATH_ARGS);
|
||||
void content_notifications_clear(PATH_ARGS);
|
||||
void content_notifications_read(PATH_ARGS);
|
||||
int content_notifications(PATH_ARGS);
|
||||
int content_notifications_compact(PATH_ARGS);
|
||||
int content_notifications_clear(PATH_ARGS);
|
||||
int content_notifications_read(PATH_ARGS);
|
||||
|
||||
void api_notifications(PATH_ARGS);
|
||||
int api_notifications(PATH_ARGS);
|
||||
|
||||
HV* perlify_notification(const struct mstdnt_notification* const notif);
|
||||
AV* perlify_notifications(const struct mstdnt_notification* const notif, size_t len);
|
||||
|
|
|
@ -40,7 +40,7 @@ enum config_category
|
|||
CONFIG_CAT_ACCOUNT
|
||||
};
|
||||
|
||||
void content_config_general(PATH_ARGS)
|
||||
int content_config_general(PATH_ARGS)
|
||||
{
|
||||
PERL_STACK_INIT;
|
||||
HV* session_hv = perlify_session(ssn);
|
||||
|
@ -64,7 +64,7 @@ void content_config_general(PATH_ARGS)
|
|||
}
|
||||
|
||||
|
||||
void content_config_appearance(PATH_ARGS)
|
||||
int content_config_appearance(PATH_ARGS)
|
||||
{
|
||||
PERL_STACK_INIT;
|
||||
HV* session_hv = perlify_session(ssn);
|
||||
|
@ -87,7 +87,7 @@ void content_config_appearance(PATH_ARGS)
|
|||
tb_free(dup);
|
||||
}
|
||||
|
||||
void content_config(PATH_ARGS)
|
||||
int content_config(PATH_ARGS)
|
||||
{
|
||||
redirect(req, REDIRECT_303, "/config/general");
|
||||
}
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
#include "session.h"
|
||||
#include "cgi.h"
|
||||
|
||||
void content_config_appearance(PATH_ARGS);
|
||||
void content_config_general(PATH_ARGS);
|
||||
//void content_config_account(PATH_ARGS);
|
||||
void content_config(PATH_ARGS);
|
||||
int content_config_appearance(PATH_ARGS);
|
||||
int content_config_general(PATH_ARGS);
|
||||
//int content_config_account(PATH_ARGS);
|
||||
int content_config(PATH_ARGS);
|
||||
|
||||
#endif // PAGE_CONFIG_H
|
||||
|
|
13
src/path.c
13
src/path.c
|
@ -28,7 +28,7 @@ int parse_path(REQUEST_T req,
|
|||
mastodont_t* api,
|
||||
struct path_info* path_info)
|
||||
{
|
||||
int res = 0;
|
||||
int res = -1;
|
||||
int fail = 0, fin = 0;
|
||||
char* p = path_info->path + 1;
|
||||
char* p2 = GET_ENV("PATH_INFO", req) + 1;
|
||||
|
@ -85,11 +85,11 @@ int parse_path(REQUEST_T req,
|
|||
breakpt:
|
||||
if (!fail)
|
||||
{
|
||||
path_info->callback(req, ssn, api, data);
|
||||
res = path_info->callback(req, ssn, api, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = 1;
|
||||
res = -1;
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
|
@ -101,22 +101,23 @@ breakpt:
|
|||
return res;
|
||||
}
|
||||
|
||||
void handle_paths(REQUEST_T req,
|
||||
int handle_paths(REQUEST_T req,
|
||||
struct session* ssn,
|
||||
mastodont_t* api,
|
||||
struct path_info* paths,
|
||||
size_t paths_len)
|
||||
{
|
||||
int res;
|
||||
char* path = GET_ENV("PATH_INFO", req);
|
||||
// "default" path
|
||||
if (path == NULL || (path && strcmp(path, "/") == 0))
|
||||
{
|
||||
content_index(req, ssn, api);
|
||||
return content_index(req, ssn, api);
|
||||
}
|
||||
else { // Generic path
|
||||
for (size_t i = 0; i < paths_len; ++i)
|
||||
{
|
||||
if (parse_path(req, ssn, api, paths + i) == 0)
|
||||
if ((res = parse_path(req, ssn, api, paths + i)) != -1)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
struct path_info
|
||||
{
|
||||
char* path;
|
||||
void (*callback)(PATH_ARGS);
|
||||
int (*callback)(PATH_ARGS);
|
||||
};
|
||||
|
||||
void handle_paths(
|
||||
int handle_paths(
|
||||
REQUEST_T req,
|
||||
struct session* ssn,
|
||||
mastodont_t* api,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "error.h"
|
||||
#include "account.h"
|
||||
|
||||
void content_search_all(PATH_ARGS)
|
||||
int content_search_all(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -102,7 +102,7 @@ void content_search_all(PATH_ARGS)
|
|||
tb_free(dup);
|
||||
}
|
||||
|
||||
void content_search_statuses(PATH_ARGS)
|
||||
int content_search_statuses(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -149,7 +149,7 @@ void content_search_statuses(PATH_ARGS)
|
|||
tb_free(dup);
|
||||
}
|
||||
|
||||
void content_search_accounts(PATH_ARGS)
|
||||
int content_search_accounts(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -195,7 +195,7 @@ void content_search_accounts(PATH_ARGS)
|
|||
tb_free(dup);
|
||||
}
|
||||
|
||||
void content_search_hashtags(PATH_ARGS)
|
||||
int content_search_hashtags(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
#include "path.h"
|
||||
#include "global_perl.h"
|
||||
|
||||
void content_search_all(PATH_ARGS);
|
||||
void content_search_statuses(PATH_ARGS);
|
||||
void content_search_accounts(PATH_ARGS);
|
||||
void content_search_hashtags(PATH_ARGS);
|
||||
int content_search_all(PATH_ARGS);
|
||||
int content_search_statuses(PATH_ARGS);
|
||||
int content_search_accounts(PATH_ARGS);
|
||||
int content_search_hashtags(PATH_ARGS);
|
||||
HV* perlify_search_results(struct mstdnt_search_results* results);
|
||||
|
||||
#endif /* SEARCH_H */
|
||||
|
|
20
src/status.c
20
src/status.c
|
@ -133,7 +133,7 @@ int try_react_status(struct session* ssn, mastodont_t* api, char* id, char* emoj
|
|||
return 0;
|
||||
}
|
||||
|
||||
void content_status_create(PATH_ARGS)
|
||||
int content_status_create(PATH_ARGS)
|
||||
{
|
||||
char* referer = getenv("HTTP_REFERER");
|
||||
|
||||
|
@ -142,7 +142,7 @@ void content_status_create(PATH_ARGS)
|
|||
redirect(req, REDIRECT_303, referer);
|
||||
}
|
||||
|
||||
void content_status_react(PATH_ARGS)
|
||||
int content_status_react(PATH_ARGS)
|
||||
{
|
||||
char* referer = getenv("HTTP_REFERER");
|
||||
|
||||
|
@ -219,7 +219,7 @@ char* get_in_reply_to(mastodont_t* api,
|
|||
}
|
||||
#endif
|
||||
|
||||
void status_interact(PATH_ARGS)
|
||||
int status_interact(PATH_ARGS)
|
||||
{
|
||||
char* referer = GET_ENV("HTTP_REFERER", req);
|
||||
|
||||
|
@ -228,7 +228,7 @@ void status_interact(PATH_ARGS)
|
|||
redirect(req, REDIRECT_303, referer);
|
||||
}
|
||||
|
||||
void api_status_interact(PATH_ARGS)
|
||||
int api_status_interact(PATH_ARGS)
|
||||
{
|
||||
if (try_interact_status(ssn, api, keystr(ssn->post.id)) == 0)
|
||||
{
|
||||
|
@ -238,22 +238,22 @@ void api_status_interact(PATH_ARGS)
|
|||
send_result(req, NULL, "application/json", "{\"status\":\"Couldn't load status\"}", 0);
|
||||
}
|
||||
|
||||
void status_view(PATH_ARGS)
|
||||
int status_view(PATH_ARGS)
|
||||
{
|
||||
content_status(req, ssn, api, data, STATUS_FOCUSED);
|
||||
}
|
||||
|
||||
void status_emoji(PATH_ARGS)
|
||||
int status_emoji(PATH_ARGS)
|
||||
{
|
||||
content_status(req, ssn, api, data, STATUS_FOCUSED | STATUS_EMOJI_PICKER);
|
||||
}
|
||||
|
||||
void status_reply(PATH_ARGS)
|
||||
int status_reply(PATH_ARGS)
|
||||
{
|
||||
content_status(req, ssn, api, data, STATUS_FOCUSED | STATUS_REPLY);
|
||||
}
|
||||
|
||||
void status_view_reblogs(PATH_ARGS)
|
||||
int status_view_reblogs(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -282,7 +282,7 @@ void status_view_reblogs(PATH_ARGS)
|
|||
mstdnt_cleanup_accounts(reblogs, reblogs_len);
|
||||
}
|
||||
|
||||
void status_view_favourites(PATH_ARGS)
|
||||
int status_view_favourites(PATH_ARGS)
|
||||
{
|
||||
struct mstdnt_args m_args;
|
||||
set_mstdnt_args(&m_args, ssn);
|
||||
|
@ -412,7 +412,7 @@ void content_status(PATH_ARGS, uint8_t flags)
|
|||
tb_free(picker);
|
||||
}
|
||||
|
||||
void notice_redirect(PATH_ARGS)
|
||||
int notice_redirect(PATH_ARGS)
|
||||
{
|
||||
char* url;
|
||||
easprintf(&url, "%s/status/%s", config_url_prefix, data[0]);
|
||||
|
|
20
src/status.h
20
src/status.h
|
@ -49,8 +49,8 @@ struct interact_profile_args
|
|||
|
||||
int try_post_status(struct session* ssn, mastodont_t* api);
|
||||
int try_interact_status(struct session* ssn, mastodont_t* api, char* id);
|
||||
void content_status_create(PATH_ARGS);
|
||||
void content_status_react(PATH_ARGS);
|
||||
int content_status_create(PATH_ARGS);
|
||||
int content_status_react(PATH_ARGS);
|
||||
|
||||
// HTML Builders
|
||||
|
||||
|
@ -63,8 +63,8 @@ char* get_in_reply_to(mastodont_t* api,
|
|||
size_t* size);
|
||||
#endif
|
||||
|
||||
void status_view_reblogs(PATH_ARGS);
|
||||
void status_view_favourites(PATH_ARGS);
|
||||
int status_view_reblogs(PATH_ARGS);
|
||||
int status_view_favourites(PATH_ARGS);
|
||||
|
||||
void content_status_interactions(FCGX_Request* req,
|
||||
struct session* ssn,
|
||||
|
@ -74,10 +74,10 @@ void content_status_interactions(FCGX_Request* req,
|
|||
size_t accts_len);
|
||||
|
||||
// Status frontends
|
||||
void status_view(PATH_ARGS);
|
||||
void status_reply(PATH_ARGS);
|
||||
void status_interact(PATH_ARGS);
|
||||
void status_emoji(PATH_ARGS);
|
||||
int status_view(PATH_ARGS);
|
||||
int status_reply(PATH_ARGS);
|
||||
int status_interact(PATH_ARGS);
|
||||
int status_emoji(PATH_ARGS);
|
||||
// Above wraps to the below function
|
||||
void content_status(PATH_ARGS, uint8_t flags);
|
||||
|
||||
|
@ -85,10 +85,10 @@ void content_status(PATH_ARGS, uint8_t flags);
|
|||
void cleanup_media_ids(struct session* ssn, char** media_ids);
|
||||
|
||||
// Redirects
|
||||
void notice_redirect(PATH_ARGS);
|
||||
int notice_redirect(PATH_ARGS);
|
||||
|
||||
// API
|
||||
void api_status_interact(PATH_ARGS);
|
||||
int api_status_interact(PATH_ARGS);
|
||||
|
||||
// Perl
|
||||
HV* perlify_status_pleroma(const struct mstdnt_status_pleroma* pleroma);
|
||||
|
|
|
@ -229,7 +229,7 @@ void tl_tag(REQUEST_T req, struct session* ssn, mastodont_t* api, char* tag_id)
|
|||
tb_free(header);
|
||||
}
|
||||
|
||||
void content_tl_home(PATH_ARGS)
|
||||
int content_tl_home(PATH_ARGS)
|
||||
{
|
||||
if (keystr(ssn->cookies.logged_in))
|
||||
tl_home(req, ssn, api, 0);
|
||||
|
@ -237,30 +237,30 @@ void content_tl_home(PATH_ARGS)
|
|||
content_tl_federated(req, ssn, api, data);
|
||||
}
|
||||
|
||||
void content_tl_direct(PATH_ARGS)
|
||||
int content_tl_direct(PATH_ARGS)
|
||||
{
|
||||
(void)data;
|
||||
tl_direct(req, ssn, api);
|
||||
}
|
||||
|
||||
void content_tl_federated(PATH_ARGS)
|
||||
int content_tl_federated(PATH_ARGS)
|
||||
{
|
||||
(void)data;
|
||||
tl_public(req, ssn, api, 0, BASE_CAT_FEDERATED);
|
||||
}
|
||||
|
||||
void content_tl_local(PATH_ARGS)
|
||||
int content_tl_local(PATH_ARGS)
|
||||
{
|
||||
(void)data;
|
||||
tl_public(req, ssn, api, 1, BASE_CAT_LOCAL);
|
||||
}
|
||||
|
||||
void content_tl_list(PATH_ARGS)
|
||||
int content_tl_list(PATH_ARGS)
|
||||
{
|
||||
tl_list(req, ssn, api, data[0]);
|
||||
}
|
||||
|
||||
void content_tl_tag(PATH_ARGS)
|
||||
int content_tl_tag(PATH_ARGS)
|
||||
{
|
||||
tl_tag(req, ssn, api, data[0]);
|
||||
}
|
||||
|
|
|
@ -44,22 +44,22 @@ void tl_tag(REQUEST_T req, struct session* ssn, mastodont_t* api, char* tag);
|
|||
/* ------------------------------------------------ */
|
||||
|
||||
/** Federated timeline */
|
||||
void content_tl_federated(PATH_ARGS);
|
||||
int content_tl_federated(PATH_ARGS);
|
||||
|
||||
/** Home timeline. Shows federated timeline if not logged in */
|
||||
void content_tl_home(PATH_ARGS);
|
||||
int content_tl_home(PATH_ARGS);
|
||||
|
||||
/** Direct message timeline */
|
||||
void content_tl_direct(PATH_ARGS);
|
||||
int content_tl_direct(PATH_ARGS);
|
||||
|
||||
/** Local/instance timeline */
|
||||
void content_tl_local(PATH_ARGS);
|
||||
int content_tl_local(PATH_ARGS);
|
||||
|
||||
/** List timeline */
|
||||
void content_tl_list(PATH_ARGS);
|
||||
int content_tl_list(PATH_ARGS);
|
||||
|
||||
/** Hashtag timeline */
|
||||
void content_tl_tag(PATH_ARGS);
|
||||
int content_tl_tag(PATH_ARGS);
|
||||
|
||||
/**
|
||||
* Used to create generic timeline content. This timeline includes other features
|
||||
|
|
Loading…
Reference in a new issue