mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-30 02:03:27 +01:00
api changes
This commit is contained in:
parent
612c6c95eb
commit
f10ce94f38
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _line_info_h
|
#ifndef _line_info_h
|
||||||
#define line_info_h
|
#define _line_info_h
|
||||||
|
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "toxic.h"
|
#include "toxic.h"
|
||||||
@ -91,4 +91,4 @@ void line_info_init(struct history *hst);
|
|||||||
void line_info_onKey(ToxWindow *self, wint_t key);
|
void line_info_onKey(ToxWindow *self, wint_t key);
|
||||||
void line_info_onDraw(ToxWindow *self);
|
void line_info_onDraw(ToxWindow *self);
|
||||||
|
|
||||||
#endif /* #define line_info_h */
|
#endif /* #define _line_info_h */
|
||||||
|
@ -102,7 +102,7 @@ void prompt_update_connectionstatus(ToxWindow *prompt, bool is_connected)
|
|||||||
|
|
||||||
/* Adds friend request to pending friend requests.
|
/* Adds friend request to pending friend requests.
|
||||||
Returns request number on success, -1 if queue is full or other error. */
|
Returns request number on success, -1 if queue is full or other error. */
|
||||||
static int add_friend_request(uint8_t *public_key)
|
static int add_friend_request(const uint8_t *public_key)
|
||||||
{
|
{
|
||||||
if (num_frnd_requests >= MAX_FRIENDS_NUM)
|
if (num_frnd_requests >= MAX_FRIENDS_NUM)
|
||||||
return -1;
|
return -1;
|
||||||
@ -403,10 +403,9 @@ static void prompt_onConnectionChange(ToxWindow *self, Tox *m, int32_t friendnum
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prompt_onFriendRequest(ToxWindow *self, Tox *m, uint8_t *key, uint8_t *data, uint16_t length)
|
static void prompt_onFriendRequest(ToxWindow *self, Tox *m, const uint8_t *key, const uint8_t *data,
|
||||||
|
uint16_t length)
|
||||||
{
|
{
|
||||||
data[length] = '\0';
|
|
||||||
|
|
||||||
ChatContext *ctx = self->chatwin;
|
ChatContext *ctx = self->chatwin;
|
||||||
|
|
||||||
uint8_t timefrmt[TIME_STR_SIZE];
|
uint8_t timefrmt[TIME_STR_SIZE];
|
||||||
|
@ -62,7 +62,7 @@ enum {
|
|||||||
Uncomment if necessary */
|
Uncomment if necessary */
|
||||||
/* #define URXVT_FIX */
|
/* #define URXVT_FIX */
|
||||||
|
|
||||||
void on_request(Tox *m, uint8_t *public_key, uint8_t *data, uint16_t length, void *userdata);
|
void on_request(Tox *m, const uint8_t *public_key, const uint8_t *data, uint16_t length, void *userdata);
|
||||||
void on_connectionchange(Tox *m, int32_t friendnumber, uint8_t status, void *userdata);
|
void on_connectionchange(Tox *m, int32_t friendnumber, uint8_t status, void *userdata);
|
||||||
void on_message(Tox *m, int32_t friendnumber, uint8_t *string, uint16_t length, void *userdata);
|
void on_message(Tox *m, int32_t friendnumber, uint8_t *string, uint16_t length, void *userdata);
|
||||||
void on_action(Tox *m, int32_t friendnumber, uint8_t *string, uint16_t length, void *userdata);
|
void on_action(Tox *m, int32_t friendnumber, uint8_t *string, uint16_t length, void *userdata);
|
||||||
|
@ -44,7 +44,7 @@ extern ToxWindow *prompt;
|
|||||||
static int num_active_windows;
|
static int num_active_windows;
|
||||||
|
|
||||||
/* CALLBACKS START */
|
/* CALLBACKS START */
|
||||||
void on_request(Tox *m, uint8_t *public_key, uint8_t *data, uint16_t length, void *userdata)
|
void on_request(Tox *m, const uint8_t *public_key, const uint8_t *data, uint16_t length, void *userdata)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ struct ToxWindow {
|
|||||||
void(*onKey)(ToxWindow *, Tox *, wint_t, bool);
|
void(*onKey)(ToxWindow *, Tox *, wint_t, bool);
|
||||||
void(*onDraw)(ToxWindow *, Tox *);
|
void(*onDraw)(ToxWindow *, Tox *);
|
||||||
void(*onInit)(ToxWindow *, Tox *);
|
void(*onInit)(ToxWindow *, Tox *);
|
||||||
void(*onFriendRequest)(ToxWindow *, Tox *, uint8_t *, uint8_t *, uint16_t);
|
void(*onFriendRequest)(ToxWindow *, Tox *, const uint8_t *, const uint8_t *, uint16_t);
|
||||||
void(*onFriendAdded)(ToxWindow *, Tox *, int32_t, bool);
|
void(*onFriendAdded)(ToxWindow *, Tox *, int32_t, bool);
|
||||||
void(*onConnectionChange)(ToxWindow *, Tox *, int32_t, uint8_t);
|
void(*onConnectionChange)(ToxWindow *, Tox *, int32_t, uint8_t);
|
||||||
void(*onMessage)(ToxWindow *, Tox *, int32_t, uint8_t *, uint16_t);
|
void(*onMessage)(ToxWindow *, Tox *, int32_t, uint8_t *, uint16_t);
|
||||||
|
Loading…
Reference in New Issue
Block a user