1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-22 22:43:01 +01:00

remove callback introduced temporarily during refactoring

This commit is contained in:
Aaron Lipinski 2013-08-18 02:05:32 +12:00
parent 9ca6c99cdc
commit 901d8eb8b9
3 changed files with 5 additions and 9 deletions

View File

@ -19,7 +19,6 @@ extern int store_data(Messenger *m, char *path);
uint8_t pending_requests[MAX_STR_SIZE][CLIENT_ID_SIZE]; // XXX uint8_t pending_requests[MAX_STR_SIZE][CLIENT_ID_SIZE]; // XXX
uint8_t num_requests = 0; // XXX uint8_t num_requests = 0; // XXX
static friendAddedFn *on_friendadded_cb;
static char prompt_buf[MAX_STR_SIZE] = {0}; static char prompt_buf[MAX_STR_SIZE] = {0};
static int prompt_buf_pos = 0; static int prompt_buf_pos = 0;
@ -97,7 +96,7 @@ void cmd_accept(ToxWindow *self, Messenger *m, char **args)
wprintw(self->window, "Failed to add friend.\n"); wprintw(self->window, "Failed to add friend.\n");
else { else {
wprintw(self->window, "Friend accepted as: %d.\n", num); wprintw(self->window, "Friend accepted as: %d.\n", num);
on_friendadded_cb(m, num); on_friendadded(m, num);
} }
} }
@ -174,7 +173,7 @@ void cmd_add(ToxWindow *self, Messenger *m, char **args)
default: default:
wprintw(self->window, "Friend added as %d.\n", num); wprintw(self->window, "Friend added as %d.\n", num);
on_friendadded_cb(m, num); on_friendadded(m, num);
break; break;
} }
} }
@ -480,9 +479,8 @@ static void prompt_onInit(ToxWindow *self, Messenger *m)
wclrtoeol(self->window); wclrtoeol(self->window);
} }
ToxWindow new_prompt(friendAddedFn *f) ToxWindow new_prompt()
{ {
on_friendadded_cb = f;
ToxWindow ret; ToxWindow ret;
memset(&ret, 0, sizeof(ret)); memset(&ret, 0, sizeof(ret));
ret.onKey = &prompt_onKey; ret.onKey = &prompt_onKey;

View File

@ -3,9 +3,7 @@
#include "windows.h" #include "windows.h"
typedef void (friendAddedFn)(Messenger *m, int friendnumber); ToxWindow new_prompt();
ToxWindow new_prompt(friendAddedFn *f);
int add_req(uint8_t *public_key); int add_req(uint8_t *public_key);
unsigned char *hex_string_to_bin(char hex_string[]); unsigned char *hex_string_to_bin(char hex_string[]);

View File

@ -154,7 +154,7 @@ void set_active_window(int index)
ToxWindow *init_windows() ToxWindow *init_windows()
{ {
int n_prompt = add_window(m, new_prompt(on_friendadded)); int n_prompt = add_window(m, new_prompt());
if (n_prompt == -1 if (n_prompt == -1
|| add_window(m, new_friendlist()) == -1 || add_window(m, new_friendlist()) == -1