aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/nogaim.h')
-rw-r--r--protocols/nogaim.h80
1 files changed, 40 insertions, 40 deletions
diff --git a/protocols/nogaim.h b/protocols/nogaim.h
index 62d800c6..cf6cdc30 100644
--- a/protocols/nogaim.h
+++ b/protocols/nogaim.h
@@ -1,7 +1,7 @@
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
- * Copyright 2002-2004 Wilmer van der Gaast and others *
+ * Copyright 2002-2010 Wilmer van der Gaast and others *
\********************************************************************/
/*
@@ -38,12 +38,20 @@
#ifndef _NOGAIM_H
#define _NOGAIM_H
+#if(__sun)
+#include <inttypes.h>
+#else
#include <stdint.h>
+#endif
+
+#include "lib/events.h"
#include "bitlbee.h"
#include "account.h"
#include "proxy.h"
#include "query.h"
+#include "md5.h"
+#include "ft.h"
#define BUDDY_ALIAS_MAXLEN 388 /* because MSN names can be 387 characters */
@@ -54,11 +62,12 @@
#define OPT_LOGGED_IN 0x00000001
#define OPT_LOGGING_OUT 0x00000002
#define OPT_AWAY 0x00000004
+#define OPT_MOBILE 0x00000008
#define OPT_DOES_HTML 0x00000010
#define OPT_LOCALBUDDY 0x00000020 /* For nicks local to one groupchat */
#define OPT_TYPING 0x00000100 /* Some pieces of code make assumptions */
#define OPT_THINKING 0x00000200 /* about these values... Stupid me! */
-#define OPT_NOOTR 0x00001000 /* protocol not suitable for OTR */
+#define OPT_NOOTR 0x00001000 /* protocol not suitable for OTR */
/* ok. now the fun begins. first we create a connection structure */
struct im_connection
@@ -85,9 +94,9 @@ struct im_connection
int evil;
/* BitlBee */
- irc_t *irc;
+ bee_t *bee;
- struct groupchat *groupchats;
+ GSList *groupchats;
};
struct groupchat {
@@ -98,10 +107,9 @@ struct groupchat {
* "nick list". This is how you can check who is in the group chat
* already, for example to avoid adding somebody two times. */
GList *in_room;
- GList *ignored;
+ //GList *ignored;
- struct groupchat *next;
- char *channel;
+ //struct groupchat *next;
/* The title variable contains the ID you gave when you created the
* chat using imcb_chat_new(). */
char *title;
@@ -112,6 +120,7 @@ struct groupchat {
/* This is for you, you can add your own structure here to extend this
* structure for your protocol's needs. */
void *data;
+ void *ui_data;
};
struct buddy {
@@ -132,6 +141,7 @@ struct prpl {
/* You should set this to the name of your protocol.
* - The user sees this name ie. when imcb_log() is used. */
const char *name;
+ void *data;
/* Maximum Message Size of this protocol.
* - Introduced for OTR, in order to fragment large protocol messages.
* - 0 means "unlimited". */
@@ -213,13 +223,19 @@ struct prpl {
* your protocol does not support publicly named group chats, then do
* not implement this. */
struct groupchat *
- (* chat_join) (struct im_connection *, const char *room, const char *nick, const char *password);
+ (* chat_join) (struct im_connection *, const char *room,
+ const char *nick, const char *password, set_t **sets);
/* Change the topic, if supported. Note that BitlBee expects the IM
server to confirm the topic change with a regular topic change
event. If it doesn't do that, you have to fake it to make it
visible to the user. */
void (* chat_topic) (struct groupchat *, char *topic);
+ /* If your protocol module needs any special info for joining chatrooms
+ other than a roomname + nickname, add them here. */
+ void (* chat_add_settings) (account_t *acc, set_t **head);
+ void (* chat_free_settings) (account_t *acc, set_t **head);
+
/* You can tell what away states your protocol supports, so that
* BitlBee will try to map the IRC away reasons to them. If your
* protocol doesn't have any, just return one generic "Away". */
@@ -232,6 +248,19 @@ struct prpl {
/* Implement these callbacks if you want to use imcb_ask_auth() */
void (* auth_allow) (struct im_connection *, const char *who);
void (* auth_deny) (struct im_connection *, const char *who);
+
+ /* Incoming transfer request */
+ void (* transfer_request) (struct im_connection *, file_transfer_t *ft, char *handle );
+
+ void (* buddy_data_add) (struct bee_user *bu);
+ void (* buddy_data_free) (struct bee_user *bu);
+
+ /* Some placeholders so eventually older plugins may cooperate with newer BitlBees. */
+ void *resv1;
+ void *resv2;
+ void *resv3;
+ void *resv4;
+ void *resv5;
};
/* im_api core stuff. */
@@ -267,6 +296,7 @@ G_MODULE_EXPORT void imcb_error( struct im_connection *ic, char *format, ... ) G
* - 'doit' or 'dont' will be called depending of the answer of the user.
*/
G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont );
+G_MODULE_EXPORT void imcb_ask_with_free( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont, query_callback myfree );
/* Two common questions you may want to ask:
* - X added you to his contact list, allow?
@@ -285,42 +315,12 @@ G_MODULE_EXPORT struct buddy *imcb_find_buddy( struct im_connection *ic, char *h
G_MODULE_EXPORT void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char *realname );
G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, const char *handle, const char *nick );
-/* Buddy activity */
-/* To manipulate the status of a handle.
- * - flags can be |='d with OPT_* constants. You will need at least:
- * OPT_LOGGED_IN and OPT_AWAY.
- * - 'state' and 'message' can be NULL */
-G_MODULE_EXPORT void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, const char *state, const char *message );
-/* Not implemented yet! */ G_MODULE_EXPORT void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle );
-/* Call when a handle says something. 'flags' and 'sent_at may be just 0. */
-G_MODULE_EXPORT void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at );
-G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags );
+G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, const char *handle, uint32_t flags );
+G_MODULE_EXPORT struct bee_user *imcb_buddy_by_handle( struct im_connection *ic, const char *handle );
G_MODULE_EXPORT void imcb_clean_handle( struct im_connection *ic, char *handle );
-/* Groupchats */
-G_MODULE_EXPORT void imcb_chat_invited( struct im_connection *ic, char *handle, char *who, char *msg, GList *data );
-/* These two functions are to create a group chat.
- * - imcb_chat_new(): the 'handle' parameter identifies the chat, like the
- * channel name on IRC.
- * - After you have a groupchat pointer, you should add the handles, finally
- * the user her/himself. At that point the group chat will be visible to the
- * user, too. */
-G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle );
-G_MODULE_EXPORT void imcb_chat_name_hint( struct groupchat *c, const char *name );
-G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, const char *handle );
-/* To remove a handle from a group chat. Reason can be NULL. */
-G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *b, const char *handle, const char *reason );
-/* To tell BitlBee 'who' said 'msg' in 'c'. 'flags' and 'sent_at' can be 0. */
-G_MODULE_EXPORT void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t flags, time_t sent_at );
-/* System messages specific to a groupchat, so they can be displayed in the right context. */
-G_MODULE_EXPORT void imcb_chat_log( struct groupchat *c, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
-/* To tell BitlBee 'who' changed the topic of 'c' to 'topic'. */
-G_MODULE_EXPORT void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at );
-G_MODULE_EXPORT void imcb_chat_free( struct groupchat *c );
-
/* Actions, or whatever. */
int imc_away_send_update( struct im_connection *ic );
-int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags );
int imc_chat_msg( struct groupchat *c, char *msg, int flags );
void imc_add_allow( struct im_connection *ic, char *handle );