Mercurial > pidgin
changeset 6350:34c07f5f34a0
[gaim-migrate @ 6849]
-Compile warning fixes from The Man (Paco-Paco)
-2 memleak fixes from me. One of them leaked the size of a chat message when
either sending or receiving, I forgot which (my bad!)
-Hopefully make AIM correctly refetch your buddy list when AOL doesn't
send it to you the first time
-Maybe something else
-Chocolate
-Vanilla
-Strawberry
-Napoleon
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 31 Jul 2003 23:21:36 +0000 |
parents | dc89c06af77e |
children | ffb1b5003772 |
files | ChangeLog src/protocols/irc/cmds.c src/protocols/irc/irc.c src/protocols/irc/msgs.c src/protocols/irc/parse.c src/protocols/oscar/aim.h src/protocols/oscar/aim_cbtypes.h src/protocols/oscar/oscar.c src/protocols/oscar/ssi.c src/server.c |
diffstat | 10 files changed, 44 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Jul 31 23:08:54 2003 +0000 +++ b/ChangeLog Thu Jul 31 23:21:36 2003 +0000 @@ -3,7 +3,6 @@ version 0.67 * Brought back the message notification plugin (Brian Tarricone) You'll need to reconfigure your settings for this plugin - * New Jabber vCard dialog. * IRC protocol plugin rewritten (Ethan Blanton) * Various dialog rewrites (Jabber vCard, Add Group, Alias Chat, Rename Group)
--- a/src/protocols/irc/cmds.c Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/irc/cmds.c Thu Jul 31 23:21:36 2003 +0000 @@ -36,7 +36,7 @@ char *buf; if (!convo) - return; + return 1; buf = g_strdup_printf(_("Unknown command: %s"), cmd); if (gaim_conversation_get_type(convo) == GAIM_CONV_IM) @@ -163,7 +163,7 @@ convo = gaim_find_conversation_with_account(target, irc->account); if (!convo || gaim_conversation_get_type(convo) != GAIM_CONV_CHAT) - return; + return 0; if (args[1]) buf = irc_format(irc, "vcn:", "KICK", target, args[0], args[1]); @@ -191,10 +191,10 @@ else if (args[0]) buf = irc_format(irc, "vv", "MODE", args[0]); else - return; + return 0; } else if (!strcmp(cmd, "umode")) { if (!args[0]) - return; + return 0; gc = gaim_account_get_connection(irc->account); buf = irc_format(irc, "vnv", "MODE", gaim_connection_get_display_name(gc), args[0]); } @@ -276,7 +276,7 @@ irc_do_mode(irc, target, sign, ops); g_free(ops); - return; + return 0; } int irc_cmd_part(struct irc_conn *irc, const char *cmd, const char *target, const char **args) @@ -308,7 +308,7 @@ buf = irc_format(irc, "vn:", "PRIVMSG", args[0], stamp); g_free(stamp); } else { - stamp = g_strdup_printf("%s %d", target, time(NULL)); + stamp = g_strdup_printf("%s %lu", target, time(NULL)); buf = irc_format(irc, "v:", "PING", stamp); g_free(stamp); } @@ -419,13 +419,13 @@ convo = gaim_find_conversation_with_account(target, irc->account); if (!convo || gaim_conversation_get_type(convo) != GAIM_CONV_CHAT) - return; + return 0; if (!args[0]) { topic = gaim_chat_get_topic (GAIM_CHAT(convo)); if (topic) - buf = g_strdup_printf("current topic is: %s", topic); + buf = g_strdup_printf(_("current topic is: %s"), topic); else buf = g_strdup(_("No topic is set")); gaim_chat_write(GAIM_CHAT(convo), target, buf, WFLAG_SYSTEM|WFLAG_NOLOG, time(NULL)); @@ -446,7 +446,7 @@ char *buf; if (!args || !args[0]) - return; + return 0; if (!strcmp(cmd, "wallops")) buf = irc_format(irc, "v:", "WALLOPS", args[0]); @@ -503,4 +503,6 @@ irc_send(irc, buf); g_free(buf); } + + return; }
--- a/src/protocols/irc/irc.c Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/irc/irc.c Thu Jul 31 23:21:36 2003 +0000 @@ -31,6 +31,7 @@ #include "conversation.h" #include "debug.h" #include "blist.h" +#include "util.h" #include "irc.h" static void irc_buddy_append(char *name, struct irc_buddy *ib, GString *string); @@ -108,9 +109,6 @@ static GList *irc_buddy_menu(GaimConnection *gc, const char *who) { - struct irc_conn *irc = gc->proto_data; - struct proto_buddy_menu *pbm; - return NULL; } @@ -429,7 +427,7 @@ NULL, irc_away_states, NULL, - NULL, /*irc_buddy_menu,*/ + irc_buddy_menu, irc_chat_join_info, irc_login, irc_close,
--- a/src/protocols/irc/msgs.c Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/irc/msgs.c Thu Jul 31 23:21:36 2003 +0000 @@ -461,6 +461,8 @@ ib->flag = TRUE; } + g_strfreev(nicks); + g_hash_table_foreach(irc->buddies, (GHFunc)irc_buddy_status, (gpointer)irc); } @@ -690,7 +692,7 @@ if (sscanf(parts[1], "%lu", &oldstamp) != 1) { msg = g_strdup(_("Error: invalid PONG from server")); } else { - msg = g_strdup_printf(_("PING reply -- Lag: %d seconds"), time(NULL) - oldstamp); + msg = g_strdup_printf(_("PING reply -- Lag: %lu seconds"), time(NULL) - oldstamp); } convo = gaim_find_conversation_with_account(parts[0], irc->account);
--- a/src/protocols/irc/parse.c Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/irc/parse.c Thu Jul 31 23:21:36 2003 +0000 @@ -38,7 +38,6 @@ char *irc_mirc2html(const char *string); static void irc_parse_error_cb(struct irc_conn *irc, char *input); -static void irc_default_cb(struct irc_conn *irc, char *input); static char *irc_mirc_colors[16] = { "white", "black", "blue", "dark green", "red", "brown", "purple", @@ -72,6 +71,7 @@ { "401", "nt:", irc_msg_nonick }, /* No such nick/chan */ { "404", "nt:", irc_msg_nosend }, /* Cannot send to chan */ { "421", "nv:", irc_msg_unknown }, /* Unknown command */ + { "422", "nv:", irc_msg_endmotd }, /* No MOTD available */ { "433", "vn:", irc_msg_nickused }, /* Nickname already in use */ { "442", "nc:", irc_msg_notinchan }, /* Not in channel */ { "473", "nc:", irc_msg_inviteonly }, /* Tried to join invite-only */ @@ -269,7 +269,7 @@ gc = gaim_account_get_connection(irc->account); if (!gc) return NULL; - buf = g_strdup_printf(_("Reply time from %s: %d seconds"), from, time(NULL) - timestamp); + buf = g_strdup_printf(_("Reply time from %s: %lu seconds"), from, time(NULL) - timestamp); gaim_notify_info(gc, _("PONG"), _("CTCP PING reply"), buf); g_free(buf); return NULL;
--- a/src/protocols/oscar/aim.h Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/oscar/aim.h Thu Jul 31 23:21:36 2003 +0000 @@ -1175,7 +1175,8 @@ /* These build the actual SNACs and queue them to be sent */ /* 0x0002 */ faim_export int aim_ssi_reqrights(aim_session_t *sess); -/* 0x0005 */ faim_export int aim_ssi_reqdata(aim_session_t *sess, time_t localstamp, fu16_t localrev); +/* 0x0004 */ faim_export int aim_ssi_reqdata(aim_session_t *sess); +/* 0x0005 */ faim_export int aim_ssi_reqifchanged(aim_session_t *sess, time_t localstamp, fu16_t localrev); /* 0x0007 */ faim_export int aim_ssi_enable(aim_session_t *sess); /* 0x0008 */ faim_export int aim_ssi_addmoddel(aim_session_t *sess); /* 0x0011 */ faim_export int aim_ssi_modbegin(aim_session_t *sess);
--- a/src/protocols/oscar/aim_cbtypes.h Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/oscar/aim_cbtypes.h Thu Jul 31 23:21:36 2003 +0000 @@ -209,7 +209,8 @@ #define AIM_CB_SSI_ERROR 0x0001 #define AIM_CB_SSI_REQRIGHTS 0x0002 #define AIM_CB_SSI_RIGHTSINFO 0x0003 -#define AIM_CB_SSI_REQLIST 0x0005 +#define AIM_CB_SSI_REQDATA 0x0004 +#define AIM_CB_SSI_REQIFCHANGED 0x0005 #define AIM_CB_SSI_LIST 0x0006 #define AIM_CB_SSI_ACTIVATE 0x0007 #define AIM_CB_SSI_ADD 0x0008
--- a/src/protocols/oscar/oscar.c Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/oscar/oscar.c Thu Jul 31 23:21:36 2003 +0000 @@ -3732,7 +3732,7 @@ #ifndef NOSSI gaim_debug(GAIM_DEBUG_INFO, "oscar", "ssi: requesting ssi list\n"); aim_ssi_reqrights(sess); - aim_ssi_reqdata(sess, sess->ssi.timestamp, sess->ssi.numitems); + aim_ssi_reqdata(sess); #endif aim_bos_reqlocaterights(sess, fr->conn); @@ -4750,7 +4750,7 @@ static gboolean gaim_ssi_rerequestdata(gpointer data) { aim_session_t *sess = data; - aim_ssi_reqdata(sess, sess->ssi.timestamp, sess->ssi.numitems); + aim_ssi_reqdata(sess); return FALSE; }
--- a/src/protocols/oscar/ssi.c Thu Jul 31 23:08:54 2003 +0000 +++ b/src/protocols/oscar/ssi.c Thu Jul 31 23:21:36 2003 +0000 @@ -1134,17 +1134,26 @@ } /* - * Subtype 0x0004 - Request SSI Data. - * XXX - If you don't have a timestamp and revision number? - * - * Note that the client should never increment the revision, only the server. + * Subtype 0x0004 - Request SSI Data when you don't have a timestamp and + * revision number. * */ +faim_export int aim_ssi_reqdata(aim_session_t *sess) +{ + aim_conn_t *conn; + if (!sess || !(conn = aim_conn_findbygroup(sess, AIM_CB_FAM_SSI))) + return -EINVAL; + + /* Free any current data, just in case */ + aim_ssi_freelist(sess); + + return aim_genericreq_n_snacid(sess, conn, AIM_CB_FAM_SSI, AIM_CB_SSI_REQDATA); +} /* - * Subtype 0x0005 - Request SSI Data. - * XXX - If you have a timestamp and revision number? + * Subtype 0x0005 - Request SSI Data when you have a timestamp and revision + * number. * * The data will only be sent if it is newer than the posted local * timestamp and revision. @@ -1152,7 +1161,7 @@ * Note that the client should never increment the revision, only the server. * */ -faim_export int aim_ssi_reqdata(aim_session_t *sess, time_t timestamp, fu16_t numitems) +faim_export int aim_ssi_reqifchanged(aim_session_t *sess, time_t timestamp, fu16_t numitems) { aim_conn_t *conn; aim_frame_t *fr; @@ -1164,9 +1173,9 @@ if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+4+2))) return -ENOMEM; - snacid = aim_cachesnac(sess, AIM_CB_FAM_SSI, AIM_CB_SSI_REQLIST, 0x0000, NULL, 0); + snacid = aim_cachesnac(sess, AIM_CB_FAM_SSI, AIM_CB_SSI_REQIFCHANGED, 0x0000, NULL, 0); - aim_putsnac(&fr->data, AIM_CB_FAM_SSI, AIM_CB_SSI_REQLIST, 0x0000, snacid); + aim_putsnac(&fr->data, AIM_CB_FAM_SSI, AIM_CB_SSI_REQIFCHANGED, 0x0000, snacid); aimbs_put32(&fr->data, timestamp); aimbs_put16(&fr->data, numitems); @@ -1558,7 +1567,7 @@ /* * Subtype 0x000f - SSI Data Unchanged. * - * Response to aim_ssi_reqdata() if the server-side data is not newer than + * Response to aim_ssi_reqifchanged() if the server-side data is not newer than * posted local stamp/revision. * */