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

Restyle refactor: save files are no longer global #268

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#ifdef PYTHON
#include "python_api.h"

Tox *user_tox;
Toxic *user_toxic;
static WINDOW *cur_window;
static ToxWindow *self_window;

Expand All @@ -58,33 +58,33 @@ FriendsList api_get_friendslist(void)

char *api_get_nick(void)
{
size_t len = tox_self_get_name_size(user_tox);
size_t len = tox_self_get_name_size(user_toxic->tox);
uint8_t *name = malloc(len + 1);

if (name == NULL) {
return NULL;
}

tox_self_get_name(user_tox, name);
tox_self_get_name(user_toxic->tox, name);
name[len] = '\0';
return (char *) name;
}

Tox_User_Status api_get_status(void)
{
return tox_self_get_status(user_tox);
return tox_self_get_status(user_toxic->tox);
}

char *api_get_status_message(void)
{
size_t len = tox_self_get_status_message_size(user_tox);
size_t len = tox_self_get_status_message_size(user_toxic->tox);
uint8_t *status = malloc(len + 1);

if (status == NULL) {
return NULL;
}

tox_self_get_status_message(user_tox, status);
tox_self_get_status_message(user_toxic->tox, status);
status[len] = '\0';
return (char *) status;
}
Expand Down Expand Up @@ -113,7 +113,7 @@ void api_send(const char *msg)
void api_execute(const char *input, int mode)
{
self_window = get_active_window();
execute(cur_window, self_window, user_tox, input, mode);
execute(cur_window, self_window, user_toxic, input, mode);
}

int do_plugin_command(int num_args, char (*args)[MAX_STR_SIZE])
Expand Down
Loading
Loading