--- a/src/ssip.c Tue Jan 10 08:45:38 2006 +0000
+++ b/src/ssip.c Tue Jan 17 02:33:27 2006 +0000
@@ -28,7 +28,6 @@
@@ -39,6 +38,7 @@
+#define enter (void)gaim_debug_info(__func__, "entering.\n") /** Function prototypes */
static void init_plugin(GaimPlugin *plugin);
@@ -125,16 +125,17 @@
static void ssip_close(GaimConnection *gc);
static ssip_t *ssip_create_session(GaimAccount *account);
-static void ssip_list_emblems(GaimBuddy *buddy, const char **se,
- const char **sw, const char **nw,
static const char* ssip_list_icon(GaimAccount *account, GaimBuddy *buddy);
static void ssip_login(GaimAccount *account);
static GList *ssip_node_menu(GaimBlistNode *node);
static int ssip_send_typing(GaimConnection *gc, const char *name, int typing);
+static int ssip_send_im(GaimConnection *gc, const char *who, + const char *message, GaimConvImFlags flags); static int ssip_send_im(GaimConnection *gc, const char *who,
const char *message, GaimMessageFlags flags);
/* This structure is used to indicate the buddy with whom the call is active */
typedef struct ssip_buddy_s ssip_buddy_t;
@@ -175,7 +176,7 @@
nua_handle_t *nh, ssip_oper_t *op, sip_t const *sip,
- gaim_debug_info(__func__, "entered.\n");
@@ -314,7 +315,7 @@
char const *pr_event = "presence";
- gaim_debug_info(__func__, "entered.\n");
/* If the "Enable local presence server" is checked in prpl options */
if (ssip->s_have_presence_server) {
@@ -467,11 +468,11 @@
GaimAccount *account = ssip->s_account;
- /* GaimConnection *gc = gaim_account_get_connection(account); */
+ GaimConnection *gc = NULL; + gc = gaim_account_get_connection(account); - gaim_debug_info(__func__, "entered.\n");
b = url_as_gstring(sip->sip_from->a_url);
buddy = gaim_find_buddy(account, b->str);
@@ -481,20 +482,24 @@
if (buddy && sip->sip_content_type && sip->sip_payload &&
sip->sip_payload->pl_data) {
if (strstr(sip->sip_payload->pl_data, "basic>open")) {
- gaim_prpl_got_user_status(account, buddy->name, "available", NULL);
+#ifdef SSIP_OLD_GAIM_API gaim_blist_update_buddy_presence(buddy, TRUE);
serv_got_update(gc, buddy->name, TRUE, 0, 0, 0, 2);
+ gaim_prpl_got_user_status(account, buddy->name, "available", NULL); else if (strstr(sip->sip_payload->pl_data, "basic>closed")) {
- gaim_prpl_got_user_status(account, buddy->name, "offline", NULL);
+#ifdef SSIP_OLD_GAIM_API gaim_blist_update_buddy_presence(buddy, FALSE);
serv_got_update(gc, buddy->name, FALSE, 0, 0, 0, 2);
+ gaim_prpl_got_user_status(account, buddy->name, "offline", NULL); @@ -517,7 +522,7 @@
- gaim_debug_info(__func__, "entered.\n");
op->op_callstate |= opc_recv;
@@ -695,7 +700,7 @@
- gaim_debug_info(__func__, "entered.\n");
if (status >= 200 && status < 300)
@@ -742,7 +747,7 @@
char const *passwd = NULL;
- gaim_debug_info(__func__, "entered.\n");
if (status >= 200 && status < 300) {
@@ -827,11 +832,10 @@
/* Add buddies to buddy list and subscribe to them */
- /* xxx - should we do the same with Gaim 2.0? */
else if (status == 401 || status == 407) {
if (sip && sip->sip_www_authenticate) {
@@ -1047,11 +1051,19 @@
if (!sb->sb_call_active) {
g_snprintf(buf, sizeof(buf), _("Call %s"), (char *) "buddy");
+ act = gaim_blist_node_action_new(buf, ssip_menu_invite_callback, buddy); act = gaim_blist_node_action_new(buf, ssip_menu_invite_callback, buddy, NULL);
g_snprintf(buf, sizeof(buf), _("Hangup %s"), (char *) "call");
+ act = gaim_blist_node_action_new(buf, ssip_menu_bye_callback, buddy); act = gaim_blist_node_action_new(buf, ssip_menu_bye_callback, buddy, NULL);
m = g_list_append(m, act);
@@ -1070,6 +1082,15 @@
+/* ====================================================================== */ +static void ssip_list_emblems(GaimBuddy *buddy, char **se, /* ====================================================================== */
static void ssip_list_emblems(GaimBuddy *buddy, const char **se,
const char **sw, const char **nw,
@@ -1077,7 +1098,7 @@
/* ====================================================================== */
static void ssip_get_buddies(GaimConnection *gc)
@@ -1108,7 +1129,7 @@
/* ====================================================================== */
static void ssip_add_buddy(GaimConnection *gc, GaimBuddy *buddy,
- GaimAccount *account = gc->account;
+ GaimAccount *account = NULL; GaimBuddyIcon *icon = NULL;
@@ -1120,6 +1141,10 @@
if (!HAS_SIP_PREFIX(buddy->name)) {
/* No domain was given; use ours */
if (!strchr(buddy->name, '@'))
@@ -1149,17 +1174,10 @@
- gaim_prpl_got_user_status(account, buddy->name, "offline", NULL);
serv_got_update(gc, buddy->name, FALSE, 0, 0, 0, 1);
- icon = set_icon_from_file(account, buddy,
- "/apps/gaim/share/pixmaps/gaim/status/default/male.png");
- gaim_buddy_set_icon(buddy, icon);
- gaim_blist_update_buddy_icon(buddy);
+ gaim_prpl_got_user_status(account, buddy->name, "offline", NULL); /* Subscribe to buddies */
@@ -1248,8 +1266,14 @@
/* ====================================================================== */
static int ssip_send_im(GaimConnection *gc, const char *who,
- const char *message, GaimMessageFlags flags) {
+ const char *message, GaimConvImFlags flags) +static int ssip_send_im(GaimConnection *gc, const char *who, + const char *message, GaimMessageFlags flags) GaimAccount *account = gc->account;
char const *user = gaim_account_get_username(account);
@@ -1281,14 +1305,12 @@
if (buddy->present == GAIM_BUDDY_ONLINE)
@@ -1472,9 +1494,8 @@
/* Add buddies to buddy list and subscribe to them */
/* xxx - should we do the same with Gaim 2.0? */
@@ -1607,6 +1628,7 @@
+#ifndef SSIP_OLD_GAIM_API /* ====================================================================== */
static GList *ssip_status_types(GaimAccount *account) {
@@ -1645,6 +1667,7 @@
/* sip->status = g_strdup("busy") */;
+#endif /* !SSIP_OLD_GAIM_API */ /* ====================================================================== */
@@ -1672,7 +1695,11 @@
ssip_list_emblems, /* list_emblems */
ssip_status_text, /* status_text */
ssip_status_types, /* away_states */
ssip_node_menu, /* blist_node_menu */
ssip_chat_info, /* chat_info */
NULL,//ssip_check, /* chat_info_defaults */
@@ -1682,7 +1709,11 @@
ssip_send_typing, /* send_typing */
ssip_set_status, /* set_status */
NULL, /* change_passwd */
ssip_add_buddy, /* add_buddy */