remove callback introduced temporarily during refactoring

This commit is contained in:
Aaron Lipinski 2013-08-18 02:05:32 +12:00
parent a87804cf01
commit 146f6ac645
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 num_requests = 0; // XXX
static friendAddedFn *on_friendadded_cb;
static char prompt_buf[MAX_STR_SIZE] = {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");
else {
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:
wprintw(self->window, "Friend added as %d.\n", num);
on_friendadded_cb(m, num);
on_friendadded(m, num);
break;
}
}
@ -480,9 +479,8 @@ static void prompt_onInit(ToxWindow *self, Messenger *m)
wclrtoeol(self->window);
}
ToxWindow new_prompt(friendAddedFn *f)
ToxWindow new_prompt()
{
on_friendadded_cb = f;
ToxWindow ret;
memset(&ret, 0, sizeof(ret));
ret.onKey = &prompt_onKey;

View File

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

View File

@ -154,7 +154,7 @@ void set_active_window(int index)
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
|| add_window(m, new_friendlist()) == -1