ekg2
GIT master
|
#include "ekg2.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netdb.h>
#include <sys/time.h>
#include <sys/utsname.h>
#include <pwd.h>
#include <ekg/net.h>
#include "irc.h"
#include "people.h"
#include "input.h"
#include "autoacts.h"
#include "IRCVERSION.h"
#include <ekg/vars.h>
Definicje | |
#define | DEFPORT 6667 |
#define | DEFPARTMSG "EKG2 bejbi! http://ekg2.org/" |
#define | DEFQUITMSG "EKG2 - It's better than sex!" |
#define | DEFKICKMSG "EKG2 - Y0U 57iNK2 50 MUCH!" |
#define | SGPARTMSG(x) session_get(x, "PART_MSG") |
#define | SGQUITMSG(x) session_get(x, "QUIT_MSG") |
#define | SGKICKMSG(x) session_get(x, "KICK_MSG") |
#define | PARTMSG(x, r) (r?r: SGPARTMSG(x)?SGPARTMSG(x):DEFPARTMSG) |
#define | QUITMSG(x) (SGQUITMSG(x)?SGQUITMSG(x):DEFQUITMSG) |
#define | KICKMSG(x, r) (r?r: SGKICKMSG(x)?SGKICKMSG(x):DEFKICKMSG) |
#define | getit(x) tmp[x]?tmp[x]:"*" |
#define | plvl(x) ekg_itoa(sum[x]) |
#define | VAR_MAP_ADD(v, c, l) { l, v, c } |
#define | VAR_MAP_END() { NULL, 0, 0 } |
#define | params(x) x |
#define | IRC_PLUGIN_VAR_NICKNAME 21 |
#define | IRC_PLUGIN_VAR_REALNAME 25 |
#define | IRC_ONLY SESSION_MUSTBELONG | SESSION_MUSTHASPRIVATE |
#define | IRC_FLAGS IRC_ONLY | SESSION_MUSTBECONNECTED |
#define | IRC_FLAGS_TARGET IRC_FLAGS | COMMAND_ENABLEREQPARAMS | COMMAND_PARAMASTARGET |
Funkcje | |
static int | irc_theme_init () |
static int | irc_command_disconnect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_really_connect (session_t *session, gboolean quiet) |
static char * | irc_getchan_int (session_t *s, const char *name, int checkchan) |
static char * | irc_getchan (session_t *s, const char **params, const char *name, char ***v, int pr, int checkchan) |
static int | irc_plugin_destroy () |
static int | irc_session_init (void *data, va_list ap) |
static void | list_irc_awaylog_free (irc_awaylog_t *data) |
static int | irc_session_deinit (void *data, va_list ap) |
static char * | irc_make_banmask (session_t *session, const char *nick, const char *ident, const char *hostname) |
static int | irc_print_version (void *data, va_list ap) |
static int | irc_setvar_default (void *data, va_list ap) |
static int | irc_validate_uid (void *data, va_list ap) |
out_recodes_t * | irc_find_out_recode (list_t rl, char *encname) |
static char * | irc_convert_out (irc_private_t *j, char *recipient, const char *line) |
static void | irc_changed_recode_list (session_t *s, const char *var) |
static void | irc_changed_recode (session_t *s, const char *var) |
static void | irc_changed_auto_guess_encoding (session_t *s, const char *var) |
void | irc_handle_disconnect (session_t *s, const char *reason, int type) |
static void | irc_handle_line (GDataInputStream *input, gpointer data) |
static void | irc_handle_failure (GDataInputStream *f, GError *err, gpointer data) |
static void | irc_handle_connect (GSocketConnection *conn, GInputStream *instream, GOutputStream *outstream, gpointer data) |
static void | irc_handle_connect_failure (GError *err, gpointer data) |
static int | irc_command_connect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_reconnect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_msg (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_inline_msg (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_quote (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_pipl (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_alist (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_add (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static void | irc_display_awaylog (session_t *session) |
static int | irc_command_away (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static void | irc_statusdescr_handler (session_t *s, const char *varname) |
static int | irc_window_kill (void *data, va_list ap) |
static int | irc_topic_header (void *data, va_list ap) |
static int | irc_command_names (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_topic (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_who (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_invite (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_kick (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_unban (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_ban (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_kickban (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_devop (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_ctcp (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_ping (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_me (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_mode (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_umode (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_whois (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_status_show_handle (void *data, va_list ap) |
static int | irc_command_query (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_jopacy (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | irc_command_nick (const char *name, const char **params, session_t *session, const char *target, int quiet) |
char * | nickpad_string_create (channel_t *chan) |
char * | nickpad_string_apply (channel_t *chan, const char *str) |
char * | nickpad_string_restore (channel_t *chan) |
__attribute__ ((visibility("default"))) | |
Zmienne | |
static char * | irc_config_default_access_groups |
int | irc_config_allow_fake_contacts = 0 |
int | irc_config_clean_channel_name |
const gchar | fillchars [] = "\xC2\xA0" |
const gint | fillchars_len = 2 |
plugin_t | irc_plugin = { .name = "irc", .pclass = PLUGIN_PROTOCOL , .destroy = irc_plugin_destroy, .theme_init = irc_theme_init } |
static variable_map_t | ban_type_map [] |
static plugins_params_t | irc_plugin_vars [] |
static const char * | irc_protocols [] = { "irc:", NULL } |
static const status_t | irc_statuses [] |
static const struct protocol_plugin_priv | irc_priv |
#define DEFKICKMSG "EKG2 - Y0U 57iNK2 50 MUCH!" |
#define DEFPARTMSG "EKG2 bejbi! http://ekg2.org/" |
#define DEFPORT 6667 |
#define DEFQUITMSG "EKG2 - It's better than sex!" |
#define getit | ( | x | ) | tmp[x]?tmp[x]:"*" |
#define IRC_FLAGS IRC_ONLY | SESSION_MUSTBECONNECTED |
#define IRC_FLAGS_TARGET IRC_FLAGS | COMMAND_ENABLEREQPARAMS | COMMAND_PARAMASTARGET |
#define IRC_ONLY SESSION_MUSTBELONG | SESSION_MUSTHASPRIVATE |
#define IRC_PLUGIN_VAR_NICKNAME 21 |
#define IRC_PLUGIN_VAR_REALNAME 25 |
#define KICKMSG | ( | x, | |
r | |||
) | (r?r: SGKICKMSG(x)?SGKICKMSG(x):DEFKICKMSG) |
#define params | ( | x | ) | x |
#define PARTMSG | ( | x, | |
r | |||
) | (r?r: SGPARTMSG(x)?SGPARTMSG(x):DEFPARTMSG) |
#define plvl | ( | x | ) | ekg_itoa(sum[x]) |
#define QUITMSG | ( | x | ) | (SGQUITMSG(x)?SGQUITMSG(x):DEFQUITMSG) |
#define SGKICKMSG | ( | x | ) | session_get(x, "KICK_MSG") |
#define SGPARTMSG | ( | x | ) | session_get(x, "PART_MSG") |
#define SGQUITMSG | ( | x | ) | session_get(x, "QUIT_MSG") |
#define VAR_MAP_ADD | ( | v, | |
c, | |||
l | |||
) | { l, v, c } |
#define VAR_MAP_END | ( | ) | { NULL, 0, 0 } |
__attribute__ | ( | (visibility("default")) | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
out_recodes_t* irc_find_out_recode | ( | list_t | rl, |
char * | encname | ||
) |
|
static |
|
static |
|
static |
|
static |
void irc_handle_disconnect | ( | session_t * | s, |
const char * | reason, | ||
int | type | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
handler for PLUGIN_PRINT_VERSION query requests
print info about this plugin [Copyright note+version]
|
static |
|
static |
Handler for: SESSION_REMOVED
Free memory allocated by irc_private_t if session is irc one.
Save userlist with userlist_write()
ap | 1st param: (char *) session - uid of session |
data | NULL |
|
static |
Handler for: SESSION_ADDED
Init private session struct irc_private_t if session is irc one.
Read saved userlist with userlist_read()
ap | 1st param: (char *) session - uid of session |
data | NULL |
|
static |
|
static |
|
static |
|
static |
|
static |
handler for IRC_TOPIC query requests
ap | 1st param: (char *) top - place to put: -> topic of current irc channel (if current window is valid irc channel) -> ident@host of current irc user (if current window is known user) |
ap | 2nd param: (char *) setby - place to put: -> topic owner of current irc channel -> realname of current irc user |
ap | 3rd param: (char *) modes - place to put: modes of current irc channel or undefined if not channel |
data | 0 |
|
static |
handler for PROTOCOL_VALIDATE_UID
checks, if uid is proper for irc plugin.
ap | 1st param: (char *) uid - of user/session/command/whatever |
ap | 2nd param: (int) valid - place to put 1 if uid is valid for irc plugin. |
data | NULL |
|
static |
handler for UI_WINDOW_KILL query requests It checks if window which will be destroyed is valid irc channel window, and we are on it now. if yes (and of course if we are connected) it send PART message to irc server, with reason got using PARTMSG macro
ap | 1st param: (window_t *) w - window which will be destroyed |
data | NULL |
|
static |
char* nickpad_string_apply | ( | channel_t * | chan, |
const char * | str | ||
) |
char* nickpad_string_create | ( | channel_t * | chan | ) |
char* nickpad_string_restore | ( | channel_t * | chan | ) |
|
static |
const gchar fillchars[] = "\xC2\xA0" |
const gint fillchars_len = 2 |
int irc_config_allow_fake_contacts = 0 |
int irc_config_clean_channel_name |
|
static |
plugin_t irc_plugin = { .name = "irc", .pclass = PLUGIN_PROTOCOL , .destroy = irc_plugin_destroy, .theme_init = irc_theme_init } |
|
static |
|
static |
|
static |
|
static |