ekg2
GIT master
|
#include "ekg2.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <limits.h>
#include <unistd.h>
#include <time.h>
#include <libgadu.h>
#include "dcc.h"
#include "gg.h"
#include "misc.h"
#include "pubdir.h"
#include "images.h"
#include "pubdir50.h"
Definicje | |
#define | GG_ACK_BLOCKED 0x0001 |
#define | GG_ACK_MBOXFULL 0x0004 |
Funkcje | |
static int | gg_theme_init () |
static void | gg_session_handler_msg (session_t *s, struct gg_event *e) |
static int | gg_plugin_destroy () |
static int | gg_session_init (void *data, va_list ap) |
static int | gg_session_deinit (void *data, va_list ap) |
static int | gg_userlist_info_handle (void *data, va_list ap) |
static int | gg_user_offline_handle (void *data, va_list ap) |
static int | gg_user_online_handle (void *data, va_list ap) |
static int | gg_status_show_handle (void *data, va_list ap) |
uin_t | str_to_uin (const char *text) |
static int | gg_add_notify_handle (void *data, va_list ap) |
static int | gg_remove_notify_handle (void *data, va_list ap) |
static int | gg_print_version (void *data, va_list ap) |
static int | gg_validate_uid (void *data, va_list ap) |
static int | gg_userlist_priv_handler (void *data, va_list ap) |
static gint | gg_ping_timer_handler (gint type, session_t *s) |
static gint | gg_inv_check_handler (gint type, gpointer data) |
static void | gg_session_handler_success (session_t *s) |
static void | gg_session_handler_failure (session_t *s, struct gg_event *e) |
static void | gg_session_handler_disconnect (session_t *s) |
static void | gg_session_handler_status (session_t *s, uin_t uin, int status, const char *descr, guint32 ip, guint16 port, int protocol) |
static void | gg_session_handler_ack (session_t *s, struct gg_event *e) |
static void | gg_session_handler_image (session_t *s, struct gg_event *e) |
static void | gg_session_handler_userlist (session_t *s, struct gg_event *e) |
int | gg_session_handler (int type, int fd, watch_type_t watch, session_t *s) |
static void | gg_changed_private (session_t *s, const char *var) |
static void | gg_changed_proxy (session_t *s, const char *var) |
static void | gg_statusdescr_handler (session_t *s, const char *varname) |
static int | gg_typing_out (void *data, va_list ap) |
static int | gg_setvar_default (void *data, va_list ap) |
static void | libgadu_debug_handler (int level, const char *format, va_list ap) |
static gint | gg_scroll_timer (gint type, gpointer data) |
int | __attribute__ ((visibility("default"))) |
Zmienne | |
plugin_t | gg_plugin = { .name = "gg", .pclass = PLUGIN_PROTOCOL , .destroy = gg_plugin_destroy, .theme_init = gg_theme_init } |
list_t | gg_currently_checked = NULL |
char * | last_tokenid |
int | gg_config_display_token |
int | gg_config_skip_default_format |
int | gg_config_split_messages |
int | gg_config_enable_chatstates = 1 |
static plugins_params_t | gg_plugin_vars [] |
static const char * | gg_protocols [] = { "gg:", NULL } |
static const status_t | gg_statuses [] |
static const struct protocol_plugin_priv | gg_priv |
#define GG_ACK_BLOCKED 0x0001 |
#define GG_ACK_MBOXFULL 0x0004 |
int __attribute__ | ( | (visibility("default")) | ) |
|
static |
Handler for: ADD_NOTIFY
(Emited by: /add command, when you successfully add smb to the userlist)
Notify gg server about it.
ap | 1st param: (char *) session_uid - session uid |
ap | 2nd param: (char *) uid - user uid |
data | NULL |
|
static |
When connected, notify gg server about our privacy policy [Do we or don't we want to notify users not in our userlist about our status/description
Handler executed when session variable: "private" change.
s | - session |
var | - session variable name |
|
static |
changed_proxy()
Handler execute when session variable: "proxy" change
|
static |
|
static |
|
static |
|
static |
|
static |
Handler for: REMOVE_NOTIFY
(Emited by: /del command, when we sucessfully remove smb from userlist.
Notify gg server about it.
ap | 1st param: (char *) session_uid - session uid |
ap | 2nd param: (char *) uid - user uid |
data | NULL |
|
static |
|
static |
Handler for: SESSION_REMOVED
Free memory allocated by gg_private_t if session is gg one.
ap | 1st param: (char *) session - uid of session |
data | NULL |
int gg_session_handler | ( | int | type, |
int | fd, | ||
watch_type_t | watch, | ||
session_t * | s | ||
) |
|
static |
Support for messages acknowledgement.
Handler for libgadu: GG_EVENT_ACK events
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Handler for: SESSION_ADDED
Init private session struct gg_private_t if session is gg one.
Read saved userlist by userlist_read()
ap | 1st param: (char *) session - uid of session |
data | NULL |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Handler for: USERLIST_INFO
(Emited by: /list command, when we want know more about given user)
printq() all gg-protocol-only-data like: possible client version [read: which version of protocol he use], if he has voip, etc..
ap | 1st param: (userlist_t *) u - item. |
ap | 2nd param: (int) quiet - If quiet for printq() |
data | NULL |
|
static |
|
static |
handler for PROTOCOL_VALIDATE_UID
checks, if uid is proper for gg plugin.
Blah, irc does xstrncasecmp() here it's only xstrncmp() let's decide... GG: and gg: is proper, or only gg:
Maybe let's check if after gg: we have max 32b number.. because libgadu and gg protocol only support 32bit uids... ;)
ap | 1st param: (char *) uid - of user/session/command/whatever |
ap | 2nd param: (int) valid - place to put 1 if uid is valid for gg plugin. |
data | NULL |
|
static |
Handler for libgadu: gg_debug_handler
It's communcation channel between libgadu debug messages, and ekg2.
Here we translate libgadu levels to ekg2 one, and than pass it to ekg_debug_handler()
level | - libgadu debug level |
uin_t str_to_uin | ( | const char * | text | ) |
int gg_config_display_token |
int gg_config_enable_chatstates = 1 |
int gg_config_skip_default_format |
int gg_config_split_messages |
plugin_t gg_plugin = { .name = "gg", .pclass = PLUGIN_PROTOCOL , .destroy = gg_plugin_destroy, .theme_init = gg_theme_init } |
|
static |
|
static |
|
static |
|
static |
char* last_tokenid |