From: Piotr S. <ps...@us...> - 2009-09-17 12:05:39
|
Update of /cvsroot/ayttm/ayttm/modules/jabber In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12682/modules/jabber Modified Files: jabber.c libEBjabber.c libEBjabber.h Log Message: reformatted source code Index: jabber.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/jabber.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- jabber.c 6 Sep 2009 18:23:08 -0000 1.60 +++ jabber.c 17 Sep 2009 12:04:59 -0000 1.61 @@ -62,27 +62,26 @@ ************************************************************************************/ /* Module defines */ #ifndef USE_POSIX_DLOPEN - #define plugin_info jabber_LTX_plugin_info - #define SERVICE_INFO jabber_LTX_SERVICE_INFO - #define plugin_init jabber_LTX_plugin_init - #define plugin_finish jabber_LTX_plugin_finish - #define module_version jabber_LTX_module_version +#define plugin_info jabber_LTX_plugin_info +#define SERVICE_INFO jabber_LTX_SERVICE_INFO +#define plugin_init jabber_LTX_plugin_init [...1464 lines suppressed...] eb_timeout_remove(jlad->typing_tag); } tcd->from = from; tcd->to = to; - jlad->typing_tag = eb_timeout_add(5000, (void *)eb_jabber_send_typing_stop, tcd); + jlad->typing_tag = + eb_timeout_add(5000, (void *)eb_jabber_send_typing_stop, tcd); JABBER_Send_typing(jlad->JConn, from->handle, to->handle, 1); return 4; } -static int eb_jabber_send_cr_typing( eb_chat_room *chatroom ) +static int eb_jabber_send_cr_typing(eb_chat_room *chatroom) { if (!iGetLocalPref("do_typing_notify")) return 20; - + return 4; } Index: libEBjabber.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libEBjabber.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- libEBjabber.c 30 Aug 2009 13:55:35 -0000 1.30 +++ libEBjabber.c 17 Sep 2009 12:04:59 -0000 1.31 @@ -33,19 +33,17 @@ #include "messages.h" #include "dialog.h" - #ifdef __MINGW32__ #include <glib.h> #define snprintf _snprintf #endif - extern void JABBERStatusChange(struct jabber_buddy *jb); [...1683 lines suppressed...] +void j_on_pick_account(void *data) +{ JABBER_Dialog_PTR jd; - JABBER_Conn *JConn=NULL; + JABBER_Conn *JConn = NULL; - jd=(JABBER_Dialog_PTR)data; - JConn=JCfindJID(jd->response); + jd = (JABBER_Dialog_PTR) data; + JConn = JCfindJID(jd->response); eb_debug(DBG_JBR, "Found JConn for %s: %p\n", jd->requestor, JConn); /* Call it again, this time with a good JConn */ - if(!JConn) { - fprintf(stderr, "NULL Jabber connector for buddy, should not happen!\n"); + if (!JConn) { + fprintf(stderr, + "NULL Jabber connector for buddy, should not happen!\n"); return; } JABBER_AddContact(JConn, jd->requestor); Index: libEBjabber.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libEBjabber.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- libEBjabber.h 30 Aug 2009 13:55:35 -0000 1.11 +++ libEBjabber.h 17 Sep 2009 12:04:59 -0000 1.12 @@ -16,8 +16,7 @@ extern GList *agent_list; -enum -{ +enum { JABBER_ONLINE, JABBER_AWAY, JABBER_DND, @@ -43,37 +42,35 @@ */ typedef struct JABBERCONN { - char passwd[LINE_LENGTH+1]; - char jid[LINE_LENGTH+1]; /* The jabber id, of the form user@host/resource */ - int listenerID; - jconn conn; /* The actualy jabber connection struct */ - int reg_flag; /* Indicates whether we have registered successfully with the jabber server */ - struct JABBERCONN *next; - AyConnection *connection; - int state; + char passwd[LINE_LENGTH + 1]; + char jid[LINE_LENGTH + 1]; /* The jabber id, of the form user@host/resource */ + int listenerID; + jconn conn; /* The actualy jabber connection struct */ + int reg_flag; /* Indicates whether we have registered successfully with the jabber server */ + struct JABBERCONN *next; + AyConnection *connection; + int state; int server_features; int do_request_gmail; } JABBER_Conn; typedef struct INSTANT_MESSAGE { - char *msg; /* message itself */ - char *sender; /* sender of the message */ - JABBER_Conn *JConn; + char *msg; /* message itself */ + char *sender; /* sender of the message */ + JABBER_Conn *JConn; } JABBER_InstantMessage, *JABBER_InstantMessage_PTR; - /* Use this struct to hold any service specific information you need about * local accounts * below are just some suggested values */ -typedef struct _eb_jabber_local_account_data -{ +typedef struct _eb_jabber_local_account_data { char password[MAX_PREF_LEN]; // account password - int fd; // the file descriptor - int status; // the current status of the user + int fd; // the file descriptor + int status; // the current status of the user int prompt_password; - JABBER_Conn *JConn; + JABBER_Conn *JConn; int activity_tag; int connect_tag; int typing_tag; @@ -81,33 +78,31 @@ int request_gmail; char server_port[MAX_PREF_LEN]; char ssl_server_port[MAX_PREF_LEN]; - char connect_server[MAX_PREF_LEN]; + char connect_server[MAX_PREF_LEN]; LList *jabber_contacts; } eb_jabber_local_account_data; -struct jabber_buddy -{ - char *name; /* Users name */ - char *jid; /* the buddy's id */ - char *sub; /* Subscriptions state */ - int status; /* Their current state */ - char *description; /* Their current status */ +struct jabber_buddy { + char *name; /* Users name */ + char *jid; /* the buddy's id */ + char *sub; /* Subscriptions state */ + int status; /* Their current state */ + char *description; /* Their current status */ JABBER_Conn *JConn; }; - /* ** Dialog message */ typedef struct DIALOG_MSG { - char *handle; - char *requestor; - char *message; - char *heading; - char *response; - JABBER_Conn *JConn; - void (*callback)(void *data); + char *handle; + char *requestor; + char *message; + char *heading; + char *response; + JABBER_Conn *JConn; + void (*callback) (void *data); } JABBER_Dialog, *JABBER_Dialog_PTR; /* @@ -115,11 +110,11 @@ */ typedef struct AUTH_MSG { - char *handle; - char *requestor; - JABBER_Conn *conn; + char *handle; + char *requestor; + JABBER_Conn *conn; } JABBER_AuthMessage, *JABBER_AuthMessage_PTR; - + /* ** Name: JABBER_AuthorizeContact ** Purpose: This function sends an authorize message to the server @@ -140,7 +135,8 @@ ** Output: 0 on success, -1 on failure */ -int JABBER_Login(char *handle, char *passwd, char *host, eb_jabber_local_account_data *jlad, int port); +int JABBER_Login(char *handle, char *passwd, char *host, + eb_jabber_local_account_data *jlad, int port); /* ** Name: JABBER_SendMessage ** Purpose: This function encapuslates the sending of an instant message @@ -228,10 +224,12 @@ ** Output: 0 on success, -1 on failure */ -int JABBER_SendChatRoomMessage(JABBER_Conn *JConn, char *room_name, char *message, char *nick); +int JABBER_SendChatRoomMessage(JABBER_Conn *JConn, char *room_name, + char *message, char *nick); /* Debugging routines */ void j_list_agents(); -void JABBER_Send_typing (JABBER_Conn *JConn, const char *from, const char *to, int typing); +void JABBER_Send_typing(JABBER_Conn *JConn, const char *from, const char *to, + int typing); -#endif /* __LIB_JABBER__ */ +#endif /* __LIB_JABBER__ */ |