1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge branch 'master' into osx-functional

This commit is contained in:
James Booth 2016-02-28 23:23:28 +00:00
commit cce68037e1
5 changed files with 22 additions and 0 deletions

View File

@ -197,6 +197,17 @@ api_get_current_muc(void)
} }
} }
int
api_current_win_is_console(void)
{
ProfWin *current = wins_get_current();
if (current && current->type == WIN_CONSOLE) {
return 1;
} else {
return 0;
}
}
void void
api_log_debug(const char *message) api_log_debug(const char *message)
{ {

View File

@ -43,8 +43,10 @@ int api_cons_show_themed(const char *const group, const char *const item, const
int api_cons_bad_cmd_usage(const char *const cmd); int api_cons_bad_cmd_usage(const char *const cmd);
void api_notify(const char *message, const char *category, int timeout_ms); void api_notify(const char *message, const char *category, int timeout_ms);
void api_send_line(char *line); void api_send_line(char *line);
char * api_get_current_recipient(void); char * api_get_current_recipient(void);
char * api_get_current_muc(void); char * api_get_current_muc(void);
gboolean api_current_win_is_console(void);
void api_register_command(const char *command_name, int min_args, int max_args, void api_register_command(const char *command_name, int min_args, int max_args,
const char **synopsis, const char *description, const char *arguments[][2], const char **examples, const char **synopsis, const char *description, const char *arguments[][2], const char **examples,

View File

@ -126,6 +126,12 @@ c_api_get_current_muc(void)
return api_get_current_muc(); return api_get_current_muc();
} }
static int
c_api_current_win_is_console()
{
return api_current_win_is_console();
}
static void static void
c_api_log_debug(const char *message) c_api_log_debug(const char *message)
{ {
@ -220,6 +226,7 @@ c_api_init(void)
prof_send_line = c_api_send_line; prof_send_line = c_api_send_line;
prof_get_current_recipient = c_api_get_current_recipient; prof_get_current_recipient = c_api_get_current_recipient;
prof_get_current_muc = c_api_get_current_muc; prof_get_current_muc = c_api_get_current_muc;
prof_current_win_is_console = c_api_current_win_is_console;
prof_log_debug = c_api_log_debug; prof_log_debug = c_api_log_debug;
prof_log_info = c_api_log_info; prof_log_info = c_api_log_info;
prof_log_warning = c_api_log_warning; prof_log_warning = c_api_log_warning;

View File

@ -56,6 +56,7 @@ void (*prof_send_line)(char *line) = NULL;
char* (*prof_get_current_recipient)(void) = NULL; char* (*prof_get_current_recipient)(void) = NULL;
char* (*prof_get_current_muc)(void) = NULL; char* (*prof_get_current_muc)(void) = NULL;
int (*prof_current_win_is_console)(void) = NULL;
void (*prof_log_debug)(const char *message) = NULL; void (*prof_log_debug)(const char *message) = NULL;
void (*prof_log_info)(const char *message) = NULL; void (*prof_log_info)(const char *message) = NULL;

View File

@ -56,6 +56,7 @@ void (*prof_send_line)(char *line);
char* (*prof_get_current_recipient)(void); char* (*prof_get_current_recipient)(void);
char* (*prof_get_current_muc)(void); char* (*prof_get_current_muc)(void);
int (*prof_current_win_is_console)(void);
void (*prof_log_debug)(const char *message); void (*prof_log_debug)(const char *message);
void (*prof_log_info)(const char *message); void (*prof_log_info)(const char *message);