Update of /cvsroot/gaim/gaim/src
In directory usw-pr-cvs1:/tmp/cvs-serv2508/src
Modified Files:
away.c buddy.c dialogs.c gaim.h gaimrc.c prefs.c proxy.c
server.c ui.h
Log Message:
save
save me from this
wandered around the town
all the thousand things
i might miss
and you
think we'll suffer much
think we'll close our eyes
just to see the light
pass us by
with tomorrow coming
hope that i don't let you
down again
said i'm so glad to be here
does it mean a thing
if only i could breathe what you breathe
if only i could see what you see
sit
we'll take our time
watching the flowers grow
all the friends we've known
say goodbye
and you
did you suffer much
did you close your eyes
just to see the night
rush on by
gathered all around you
hope that we don't let you
down again
i said i'm so glad to be here
does it mean a thing
if only i could breathe what you breathe
if only i could see what you see
i said i'm so glad to be here
does it mean a thing
if only i could breathe what you breathe
if only i could see what you see
if only i could just believe a thing
--Moist, "Breathe" (as transcribed by http://www.veddma.com/veddma/moist.htm)
Patches from:
Ari Pollak
Ben Miller
Mark Doliner
Sean Egan
Vincas Ciziunas
Thanks everyone.
Somewhere in the middle of all of this it started to get really tedious and annoying. I think it's getting close to the point where I quit.
Index: away.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/away.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- away.c 2001/12/08 09:48:51 1.68
+++ away.c 2001/12/21 10:23:04 1.69
@@ -219,6 +219,8 @@
awaytext = gtk_imhtml_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(sw), awaytext);
+ GTK_LAYOUT(awaytext)->hadjustment->step_increment = 10.0;
+ GTK_LAYOUT(awaytext)->vadjustment->step_increment = 10.0;
gaim_setup_imhtml(awaytext);
gtk_widget_show(awaytext);
buf = stylize(a->message, BUF_LONG);
Index: buddy.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/buddy.c,v
retrieving revision 1.282
retrieving revision 1.283
diff -u -d -r1.282 -r1.283
--- buddy.c 2001/12/14 20:39:26 1.282
+++ buddy.c 2001/12/21 10:23:04 1.283
@@ -2113,6 +2113,14 @@
char tmp[1024];
g_snprintf(tmp, sizeof(tmp), _("%s logged in."), b->name);
write_to_conv(c, tmp, WFLAG_SYSTEM, NULL, time(NULL), -1);
+ } else if (clistqueue && find_queue_total_by_name(b->name)) {
+ struct queued_message *qm = g_new0(struct queued_message, 1);
+ qm->message = g_strdup_printf(_("%s logged in."), b->name);
+ qm->gc = gc;
+ qm->tm = time(NULL);
+ qm->flags = WFLAG_SYSTEM;
+ qm->len = -1;
+ message_queue = g_slist_append(message_queue, qm);
}
}
bs->sound = 2;
@@ -2168,6 +2176,14 @@
char tmp[1024];
g_snprintf(tmp, sizeof(tmp), _("%s logged out."), b->name);
write_to_conv(c, tmp, WFLAG_SYSTEM, NULL, time(NULL), -1);
+ } else if (clistqueue && find_queue_total_by_name(b->name)) {
+ struct queued_message *qm = g_new0(struct queued_message, 1);
+ qm->message = g_strdup_printf(_("%s logged out."), b->name);
+ qm->gc = gc;
+ qm->tm = time(NULL);
+ qm->flags = WFLAG_SYSTEM;
+ qm->len = -1;
+ message_queue = g_slist_append(message_queue, qm);
}
}
Index: dialogs.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/dialogs.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -d -r1.296 -r1.297
--- dialogs.c 2001/12/08 09:48:51 1.296
+++ dialogs.c 2001/12/21 10:23:04 1.297
@@ -1853,8 +1853,6 @@
gtk_imhtml_append_text(GTK_IMHTML(b->text), more_info, -1, options);
va_end(ap);
- gtk_imhtml_append_text(GTK_IMHTML(b->text), "<BR>", -1, 0);
-
if (away)
info_dlgs = g_slist_remove(info_dlgs, b);
else
@@ -3769,6 +3767,8 @@
gtk_signal_connect(GTK_OBJECT(layout), "url_clicked", GTK_SIGNAL_FUNC(open_url), NULL);
gtk_container_add(GTK_CONTAINER(sw), layout);
+ GTK_LAYOUT(layout)->hadjustment->step_increment = 10.0;
+ GTK_LAYOUT(layout)->vadjustment->step_increment = 10.0;
gaim_setup_imhtml(layout);
gtk_box_pack_start(GTK_BOX(box), bbox, FALSE, FALSE, 0);
Index: gaim.h
===================================================================
RCS file: /cvsroot/gaim/gaim/src/gaim.h,v
retrieving revision 1.303
retrieving revision 1.304
diff -u -d -r1.303 -r1.304
--- gaim.h 2001/12/08 09:48:51 1.303
+++ gaim.h 2001/12/21 10:23:04 1.304
@@ -307,7 +307,9 @@
#define OPT_AWAY_AUTO 0x00000008
#define OPT_AWAY_NO_AUTO_RESP 0x00000010
#define OPT_AWAY_QUEUE 0x00000020
+#define OPT_AWAY_IDLE_RESP 0x00000040
+extern guint away_resend;
extern int report_idle;
extern int web_browser;
extern GSList *aim_users;
Index: gaimrc.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/gaimrc.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- gaimrc.c 2001/11/20 06:16:15 1.90
+++ gaimrc.c 2001/12/21 10:23:04 1.91
@@ -49,6 +49,7 @@
guint font_options;
guint sound_options;
guint away_options;
+guint away_resend;
int report_idle, web_browser;
struct save_pos blist_pos;
@@ -731,6 +732,7 @@
sound_options = atoi(p->value[0]);
} else if (!strcmp(p->option, "away_options")) {
away_options = atoi(p->value[0]);
+ away_resend = atoi(p->value[1]);
} else if (!strcmp(p->option, "font_xfld")) {
g_snprintf(fontxfld, sizeof(fontxfld), "%s", p->value[0]);
} else if (!strcmp(p->option, "font_face")) {
@@ -807,6 +809,9 @@
for (i = 0; disp_replace[i].val; i++)
if (display_options & disp_replace[i].old)
*disp_replace[i].val |= disp_replace[i].new;
+
+ if (!away_resend)
+ away_resend = 120;
}
static void gaimrc_write_options(FILE *f)
Index: prefs.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/prefs.c,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -d -r1.211 -r1.212
--- prefs.c 2001/12/08 09:48:52 1.211
+++ prefs.c 2001/12/21 10:23:04 1.212
@@ -829,7 +829,7 @@
*value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin));
}
-static void gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val)
+static void gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max)
{
GtkWidget *hbox;
GtkWidget *label;
@@ -844,7 +844,7 @@
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
gtk_widget_show(label);
- adjust = gtk_adjustment_new(*val, 1, 9999, 1, 1, 1);
+ adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1);
spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
gtk_object_set_user_data(GTK_OBJECT(spin), val);
gtk_widget_set_usize(spin, 50, -1);
@@ -949,9 +949,9 @@
gtk_container_add(GTK_CONTAINER(frame), vbox);
gtk_widget_show(vbox);
- gaim_labeled_spin_button(vbox, _("New window width:"), &conv_size.width);
- gaim_labeled_spin_button(vbox, _("New window height:"), &conv_size.height);
- gaim_labeled_spin_button(vbox, _("Entry widget height:"), &conv_size.entry_height);
+ gaim_labeled_spin_button(vbox, _("New window width:"), &conv_size.width, 25, 9999);
+ gaim_labeled_spin_button(vbox, _("New window height:"), &conv_size.height, 25, 9999);
+ gaim_labeled_spin_button(vbox, _("Entry widget height:"), &conv_size.entry_height, 25, 9999);
frame = gtk_frame_new(_("Tab Placement"));
gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5);
@@ -1093,9 +1093,9 @@
gtk_container_add(GTK_CONTAINER(frame), vbox);
gtk_widget_show(vbox);
- gaim_labeled_spin_button(vbox, _("New window width:"), &buddy_chat_size.width);
- gaim_labeled_spin_button(vbox, _("New window height:"), &buddy_chat_size.height);
- gaim_labeled_spin_button(vbox, _("Entry widget height:"), &buddy_chat_size.entry_height);
+ gaim_labeled_spin_button(vbox, _("New window width:"), &buddy_chat_size.width, 25, 9999);
+ gaim_labeled_spin_button(vbox, _("New window height:"), &buddy_chat_size.height, 25, 9999);
+ gaim_labeled_spin_button(vbox, _("Entry widget height:"), &buddy_chat_size.entry_height, 25, 9999);
frame = gtk_frame_new(_("Tab Placement"));
gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5);
@@ -1823,11 +1823,12 @@
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *vbox2;
+ GtkWidget *button;
+ GtkWidget *button2;
GtkWidget *top;
GtkWidget *bot;
GtkWidget *sw;
GtkWidget *sw2;
- GtkWidget *button;
GtkWidget *list_item;
GtkWidget *sep;
GtkObject *adjust;
@@ -1875,7 +1876,12 @@
gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 5);
gtk_widget_show(vbox2);
- gaim_button(_("Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox2);
+ button = gaim_button(_("Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox2);
+ button2 = gaim_button(_("Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP,
+ vbox2);
+ if (away_options & OPT_AWAY_NO_AUTO_RESP)
+ gtk_widget_set_sensitive(button2, FALSE);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), button2);
gaim_button(_("Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox2);
sep = gtk_hseparator_new();
@@ -1886,6 +1892,21 @@
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show(hbox);
+ gaim_labeled_spin_button(hbox, _("Time between sending auto-responses (in seconds):"),
+ &away_resend, 1, 24 * 60 * 60);
+
+ if (away_options & OPT_AWAY_NO_AUTO_RESP)
+ gtk_widget_set_sensitive(hbox, FALSE);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), hbox);
+
+ sep = gtk_hseparator_new();
+ gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
+ gtk_widget_show(sep);
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+
button = gaim_button(_("Auto Away after"), &away_options, OPT_AWAY_AUTO, hbox);
adjust = gtk_adjustment_new(auto_away, 1, 1440, 1, 10, 10);
@@ -1957,6 +1978,8 @@
away_text = gtk_imhtml_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(sw2), away_text);
+ GTK_LAYOUT(away_text)->hadjustment->step_increment = 10.0;
+ GTK_LAYOUT(away_text)->vadjustment->step_increment = 10.0;
gaim_setup_imhtml(away_text);
gtk_widget_show(away_text);
Index: proxy.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/proxy.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- proxy.c 2001/12/20 21:01:59 1.36
+++ proxy.c 2001/12/21 10:23:04 1.37
@@ -33,6 +33,7 @@
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -118,6 +119,24 @@
g_source_remove(tag);
}
+static struct sockaddr_in *gaim_gethostbyname(char *host)
+{
+ static struct sockaddr_in sin;
+
+ if (!inet_aton(host, &sin.sin_addr)) {
+ struct hostent *hp;
+ if (!(hp = gethostbyname(host))) {
+ return NULL;
+ }
+ memset(&sin, 0, sizeof(struct sockaddr_in));
+ memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
+ sin.sin_family = hp->h_addrtype;
+ } else
+ sin.sin_family = AF_INET;
+
+ return &sin;
+}
+
static void no_one_calls(gpointer data, gint source, GaimInputCondition cond)
{
struct PHB *phb = data;
@@ -151,31 +170,25 @@
static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb)
{
- struct sockaddr_in sin;
- struct hostent *hp;
+ struct sockaddr_in *sin;
int fd = -1;
debug_printf("connecting to %s:%d with no proxy\n", host, port);
- if (!(hp = gethostbyname(host))) {
+ if (!(sin = gaim_gethostbyname(host))) {
debug_printf("gethostbyname failed\n");
g_free(phb);
return -1;
}
-
- memset(&sin, 0, sizeof(struct sockaddr_in));
- memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = htons(port);
- if ((fd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
+ if ((fd = socket(sin->sin_family, SOCK_STREAM, 0)) < 0) {
debug_printf("unable to create socket\n");
g_free(phb);
return -1;
}
fcntl(fd, F_SETFL, O_NONBLOCK);
- if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+ if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0) {
if ((errno == EINPROGRESS) || (errno == EINTR)) {
debug_printf("Connect would have blocked\n");
phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, no_one_calls, phb);
@@ -302,23 +315,17 @@
static int proxy_connect_http(char *host, unsigned short port, struct PHB *phb)
{
- struct hostent *hp;
- struct sockaddr_in sin;
+ struct sockaddr_in *sin;
int fd = -1;
debug_printf("connecting to %s:%d via %s:%d using HTTP\n", host, port, proxyhost, proxyport);
- if (!(hp = gethostbyname(proxyhost))) {
+ if (!(sin = gaim_gethostbyname(proxyhost))) {
g_free(phb);
return -1;
}
- memset(&sin, 0, sizeof(struct sockaddr_in));
- memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = htons(proxyport);
-
- if ((fd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
+ if ((fd = socket(sin->sin_family, SOCK_STREAM, 0)) < 0) {
g_free(phb);
return -1;
}
@@ -327,7 +334,7 @@
phb->port = port;
fcntl(fd, F_SETFL, O_NONBLOCK);
- if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+ if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0) {
if ((errno == EINPROGRESS) || (errno == EINTR)) {
debug_printf("Connect would have blocked\n");
phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, http_canwrite, phb);
@@ -427,23 +434,17 @@
static int proxy_connect_socks4(char *host, unsigned short port, struct PHB *phb)
{
- struct sockaddr_in sin;
- struct hostent *hp;
+ struct sockaddr_in *sin;
int fd = -1;
debug_printf("connecting to %s:%d via %s:%d using SOCKS4\n", host, port, proxyhost, proxyport);
- if (!(hp = gethostbyname(proxyhost))) {
+ if (!(sin = gaim_gethostbyname(proxyhost))) {
g_free(phb);
return -1;
}
-
- memset(&sin, 0, sizeof(struct sockaddr_in));
- memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = htons(proxyport);
- if ((fd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
+ if ((fd = socket(sin->sin_family, SOCK_STREAM, 0)) < 0) {
g_free(phb);
return -1;
}
@@ -452,7 +453,7 @@
phb->port = port;
fcntl(fd, F_SETFL, O_NONBLOCK);
- if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+ if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0) {
if ((errno == EINPROGRESS) || (errno == EINTR)) {
debug_printf("Connect would have blocked\n");
phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, s4_canwrite, phb);
@@ -656,23 +657,17 @@
static int proxy_connect_socks5(char *host, unsigned short port, struct PHB *phb)
{
+ struct sockaddr_in *sin;
int fd = -1;
- struct sockaddr_in sin;
- struct hostent *hp;
debug_printf("connecting to %s:%d via %s:%d using SOCKS5\n", host, port, proxyhost, proxyport);
- if (!(hp = gethostbyname(proxyhost))) {
+ if (!(sin = gaim_gethostbyname(proxyhost))) {
g_free(phb);
return -1;
}
- memset(&sin, 0, sizeof(struct sockaddr_in));
- memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = htons(proxyport);
-
- if ((fd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
+ if ((fd = socket(sin->sin_family, SOCK_STREAM, 0)) < 0) {
g_free(phb);
return -1;
}
@@ -681,7 +676,7 @@
phb->port = port;
fcntl(fd, F_SETFL, O_NONBLOCK);
- if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+ if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0) {
if ((errno == EINPROGRESS) || (errno == EINTR)) {
debug_printf("Connect would have blocked\n");
phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, s5_canwrite, phb);
Index: server.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/server.c,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -d -r1.214 -r1.215
--- server.c 2001/12/08 09:48:52 1.214
+++ server.c 2001/12/21 10:23:04 1.215
@@ -584,7 +584,8 @@
/* regardless of whether we queue it or not, we should send an auto-response. That is,
* of course, unless the horse.... no wait. */
- if ((away_options & OPT_AWAY_NO_AUTO_RESP) || !strlen(gc->away)) {
+ if ((away_options & OPT_AWAY_NO_AUTO_RESP) || !strlen(gc->away) ||
+ ((away_options & OPT_AWAY_IDLE_RESP) && !gc->is_idle)) {
g_free(name);
g_free(message);
return;
@@ -602,7 +603,7 @@
qar->sent_away = 0;
away_time_queue = g_slist_append(away_time_queue, qar);
}
- if ((t - qar->sent_away) < 120) {
+ if ((t - qar->sent_away) < away_resend) {
g_free(name);
g_free(message);
return;
@@ -978,6 +979,8 @@
text = gtk_imhtml_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(sw), text);
+ GTK_LAYOUT(text)->hadjustment->step_increment = 10.0;
+ GTK_LAYOUT(text)->vadjustment->step_increment = 10.0;
gaim_setup_imhtml(text);
hbox = gtk_hbox_new(FALSE, 5);
Index: ui.h
===================================================================
RCS file: /cvsroot/gaim/gaim/src/ui.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- ui.h 2001/12/14 18:08:24 1.26
+++ ui.h 2001/12/21 10:23:04 1.27
@@ -443,6 +443,10 @@
/* Functions in prpl.c */
extern void register_dialog();
+/* Functions in server.c */
+/* server.c is in desperate need need of a split */
+extern int find_queue_total_by_name(char *);
+
/* Functions in sound.c */
extern void play_sound(int);
extern void play_file(char *);
|