Remove unused code

This commit is contained in:
mjentsch 2014-10-06 22:56:02 +02:00
parent 3773562201
commit 290a3251e6
6 changed files with 1 additions and 58 deletions

View file

@ -10,29 +10,6 @@
#define COLOR_GREEN "\033[32;1m"
#define COLOR_NORMAL "\033[0m"
/**
* Log a message to the telegram-cli message log, by
* just writing it to STDOUT and appending '***'
*/
void log_printf(const char *format, va_list ap)
{
vprintf (format, ap);
}
/**
* The callback that will log the given msg to the used target
*/
void (*log_cb)(const char* format, va_list ap) = log_printf;
/**
* Set a custom logging callback to use instead of the regular
* printf to stdout
*/
void set_log_cb(void (*cb)(const char*, va_list ap))
{
log_cb = cb;
}
void hexdump (int *in_ptr, int *in_end) {
int *ptr = in_ptr;
while (ptr < in_end) { printf (" %08x", *(ptr ++)); }

View file

@ -4,7 +4,6 @@
* Set a custom logging callback to use instead of regular printing
* to stdout
*/
void set_log_cb(void (*cb)(const char*, va_list ap));
void hexdump (int *in_ptr, int *in_end);
void debug(const char* format, ...);

View file

@ -61,17 +61,6 @@ PurpleGroup *tggroup;
void tgprpl_login_on_connected();
/**
* Formats the given format string with the given arguments and writes
* it to the libpurple log
*/
void tg_cli_log_cb(const char* format, va_list ap)
{
char buffer[256];
vsnprintf(buffer, sizeof(buffer), format, ap);
purple_debug_info(PLUGIN_ID, "%s", buffer);
}
void message_allocated_handler (struct telegram *instance, struct message *M);
void peer_allocated_handler (struct telegram *instance, void *user);
void user_info_received_handler (struct telegram *instance, struct tgl_user *user, int showInfo);
@ -934,7 +923,6 @@ static GList *tgprpl_status_types(PurpleAccount * acct)
static void tgprpl_set_status(PurpleAccount * acct, PurpleStatus * status)
{
purple_debug_info(PLUGIN_ID, "tgprpl_set_status()\n");
}
/**
@ -1229,10 +1217,7 @@ static void tgprpl_init(PurplePlugin *plugin)
PurpleAccountOption *option;
PurpleAccountUserSplit *split;
GList *verification_values = NULL;
// Redirect the msglog of the telegram-cli application to the libpurple logger
set_log_cb(&tg_cli_log_cb);
// Extra Options
#define ADD_VALUE(list, desc, v) { \
PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \

View file

@ -39,7 +39,6 @@ DEFINE_TREE(peer,peer_t *,peer_cmp,0)
DEFINE_TREE(peer_by_name,peer_t *,peer_cmp_name,0)
DEFINE_TREE(message,struct message *,id_cmp,0)
struct message message_list = {
.next_use = &message_list,
.prev_use = &message_list

View file

@ -454,20 +454,6 @@ void telegram_dl_next (struct telegram *instance)
}
}
/**
* Login, and perform a registration when needed
*/
int telegram_login(struct telegram *instance)
{
if (instance->session_state != STATE_AUTHORIZED) {
debug("Cannot log in, invalid state: %d \n", instance->session_state);
return -1;
}
do_help_get_config(instance);
telegram_change_state(instance, STATE_CONFIG_REQUESTED, NULL);
return 0;
}
void on_authorized(struct mtproto_connection *c UU, void *data)
{
debug ("on_authorized()...\n");

View file

@ -331,8 +331,6 @@ void telegram_change_state(struct telegram *instance, int state, void *data);
*/
void telegram_connect(struct telegram *instance);
int telegram_login (struct telegram *instance);
/**
* Read and process all available input from the network
*/
@ -425,7 +423,6 @@ struct mtproto_connection *telegram_add_proxy(struct telegram *tg, struct proxy_
int telegram_authenticated (struct telegram *instance);
void telegram_flush (struct telegram *instance);
void telegram_dl_add (struct telegram *instance, struct download *dl);
void telegram_dl_next (struct telegram *instance);