# HG changeset patch # User Sean Egan # Date 1018840989 0 # Node ID 0097f5462ac2cc628cdf7e4b7215290b2042cba9 # Parent 746a661b8bfe07af6021abdbd3ac1496b930db6e [gaim-migrate @ 3166] Patches by Max Horn, Nathan Walp and Danny Colascione. Thanks, guys. committer: Tailor Script diff -r 746a661b8bfe -r 0097f5462ac2 ChangeLog --- a/ChangeLog Sun Apr 14 22:44:28 2002 +0000 +++ b/ChangeLog Mon Apr 15 03:23:09 2002 +0000 @@ -3,6 +3,8 @@ version 0.57 * New authorization method for Yahoo! * Polish translation updated (Thanks Przemyslaw Sulek) + * Jabber will tell you when your buddies signed on (Thanks + Nathan Walp) version 0.56 (04/11/2002): * German translation update (Thanks Karsten Weiss) diff -r 746a661b8bfe -r 0097f5462ac2 acconfig.h --- a/acconfig.h Sun Apr 14 22:44:28 2002 +0000 +++ b/acconfig.h Mon Apr 15 03:23:09 2002 +0000 @@ -22,3 +22,4 @@ #ifndef STATIC_PROTO_INIT #undef STATIC_PROTO_INIT #endif +#undef socklen_t diff -r 746a661b8bfe -r 0097f5462ac2 configure.ac --- a/configure.ac Sun Apr 14 22:44:28 2002 +0000 +++ b/configure.ac Mon Apr 15 03:23:09 2002 +0000 @@ -41,6 +41,21 @@ AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, , [AC_ERROR(inet_aton not found)])]) +dnl Check for socklen_t (in Unix98) +AC_MSG_CHECKING(for socklen_t) +AC_TRY_COMPILE([#include +#include +socklen_t x; +], [], [AC_MSG_RESULT(yes)], [ +AC_TRY_COMPILE([#include +#include +int accept(int, struct sockaddr *, size_t *); +], [], [ +AC_MSG_RESULT(size_t) +AC_DEFINE(socklen_t, size_t)]. [ +AC_MSG_RESULT(int) +AC_DEFINE(socklen_t, int)])]) + dnl This is a bad, bad hack. I am a bad, bad man. CFLAGS="$CFLAGS -I/usr/local/include -I/opt/include -I\$(top_srcdir)" diff -r 746a661b8bfe -r 0097f5462ac2 src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Sun Apr 14 22:44:28 2002 +0000 +++ b/src/protocols/jabber/jabber.c Mon Apr 15 03:23:09 2002 +0000 @@ -894,17 +894,33 @@ struct buddy *b = NULL; jid who; char *buddy; - xmlnode y; + xmlnode y,z; char *show; int state = 0; GSList *resources; char *res; struct conversation *cnv = NULL; struct jabber_chat *jc = NULL; + time_t signon = time(NULL); + to = xmlnode_get_attrib(p->x, "to"); from = xmlnode_get_attrib(p->x, "from"); type = xmlnode_get_attrib(p->x, "type"); + + z = xmlnode_get_tag(p->x, "x"); + + if(NSCHECK(z,NS_DELAY)) + { + struct tm t; + char *timestamp = xmlnode_get_attrib(z,"stamp"); + if(sscanf(timestamp,"%04d%02d%02dT%02d:%02d:%02d", &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec)) + { + t.tm_year -= 1900; + t.tm_mon -= 1; + signon = mktime(&t) - timezone; + } + } if ((y = xmlnode_get_tag(p->x, "show"))) { show = xmlnode_get_data(y); @@ -972,7 +988,7 @@ b->proto_data = g_slist_append(b->proto_data, g_strdup(res)); } - serv_got_update(GJ_GC(gjc), buddy, 1, 0, 0, 0, state, 0); + serv_got_update(GJ_GC(gjc), buddy, 1, 0, b->signon ? b->signon : signon, b->idle, state, 0); } } else { @@ -1133,6 +1149,8 @@ if(groupname && c_grp && strcmp(c_grp->name, groupname)) { int present = b->present; /* save presence state */ int uc = b->uc; /* and away state (?) */ + int idle = b->idle; + int signon = b->signon; /* * seems rude, but it seems to be the only way... @@ -1142,7 +1160,7 @@ name ? name : buddyname); do_export(GJ_GC(gjc)); if(present) { - serv_got_update(GJ_GC(gjc), buddyname, 1, 0, 0, 0, uc, 0); + serv_got_update(GJ_GC(gjc), buddyname, 1, 0, signon, idle, uc, 0); } } else if(name != NULL && strcmp(b->show, name)) { strncpy(b->show, name, BUDDY_ALIAS_MAXLEN); diff -r 746a661b8bfe -r 0097f5462ac2 src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Sun Apr 14 22:44:28 2002 +0000 +++ b/src/protocols/oscar/oscar.c Mon Apr 15 03:23:09 2002 +0000 @@ -59,10 +59,6 @@ #include "pixmaps/gnomeicu-occ.xpm" #include "pixmaps/gnomeicu-ffc.xpm" -#if (defined(__SVR4) && !defined(_SOCKLEN_T)) || defined(__MACH__) -typedef uint32_t socklen_t; -#endif - /* constants to identify proto_opts */ #define USEROPT_AUTH 0 #define USEROPT_AUTHPORT 1 diff -r 746a661b8bfe -r 0097f5462ac2 src/prpl.c --- a/src/prpl.c Sun Apr 14 22:44:28 2002 +0000 +++ b/src/prpl.c Mon Apr 15 03:23:09 2002 +0000 @@ -561,7 +561,7 @@ ga->who = g_strdup(who); ga->alias = alias ? g_strdup(alias) : NULL; - g_snprintf(buf, sizeof(buf), _("%s%s%s%s has made %s their buddy%s%s%s"), + g_snprintf(buf, sizeof(buf), _("%s%s%s%s has made %s his or her buddy%s%s%s"), who, alias ? " (" : "", alias ? alias : "", @@ -569,7 +569,7 @@ id ? id : gc->displayname[0] ? gc->displayname : gc->username, msg ? ": " : ".", msg ? msg : "", - find_buddy(gc, ga->who) ? "" : _("\n\nDo you wish to add them to your buddy list?")); + find_buddy(gc, ga->who) ? "" : _("\n\nDo you wish to add him or her to your buddy list?")); if (find_buddy(gc, ga->who)) do_error_dialog(buf, "Added to List"); else