mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
remove callback introduced temporarily during refactoring
This commit is contained in:
parent
a87804cf01
commit
146f6ac645
|
@ -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;
|
||||||
|
|
|
@ -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[]);
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user