aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/jabber/jabber.c21
-rw-r--r--protocols/nogaim.c13
-rw-r--r--protocols/proxy.c4
-rw-r--r--protocols/yahoo/crypt.c4
-rw-r--r--protocols/yahoo/libyahoo2.c4
-rw-r--r--protocols/yahoo/yahoo_httplib.c4
-rw-r--r--protocols/yahoo/yahoo_util.c4
7 files changed, 24 insertions, 30 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index 413f77ef..fc419124 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -21,10 +21,6 @@
*
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#ifndef _WIN32
#include <sys/utsname.h>
#endif
@@ -58,6 +54,8 @@
#define DEFAULT_GROUPCHAT "conference.jabber.org"
#define DEFAULT_PORT 5222
#define DEFAULT_PORT_SSL 5223
+#define JABBER_PORT_MIN 5220
+#define JABBER_PORT_MAX 5229
#define JABBER_GROUP "Friends"
@@ -540,11 +538,6 @@ static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition c
struct jabber_data *jd;
gjconn gjc;
- if (!g_slist_find(get_connections(), gc)) {
- ssl_disconnect(source);
- return;
- }
-
jd = gc->proto_data;
gjc = jd->gjc;
@@ -553,6 +546,11 @@ static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition c
return;
}
+ if (!g_slist_find(get_connections(), gc)) {
+ ssl_disconnect(source);
+ return;
+ }
+
gjab_connected(data, gjc->fd, cond);
}
@@ -588,6 +586,11 @@ static void gjab_start(gjconn gjc)
port = DEFAULT_PORT;
else if (port == -1 && ssl)
port = DEFAULT_PORT_SSL;
+ else if (port < JABBER_PORT_MIN || port > JABBER_PORT_MAX) {
+ serv_got_crap(GJ_GC(gjc), "For security reasons, the Jabber port number must be in the %d-%d range.", JABBER_PORT_MIN, JABBER_PORT_MAX);
+ STATE_EVT(JCONN_STATE_OFF)
+ return;
+ }
if (server == NULL)
server = g_strdup(gjc->user->server);
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 7eb0446e..b65ddaf5 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -451,7 +451,14 @@ void signoff( struct gaim_connection *gc )
void do_error_dialog( struct gaim_connection *gc, char *msg, char *title )
{
- serv_got_crap( gc, "Error: %s", msg );
+ if( msg && title )
+ serv_got_crap( gc, "Error: %s: %s", title, msg );
+ else if( msg )
+ serv_got_crap( gc, "Error: %s", msg );
+ else if( title )
+ serv_got_crap( gc, "Error: %s", title );
+ else
+ serv_got_crap( gc, "Error" );
}
void do_ask_dialog( struct gaim_connection *gc, char *msg, void *data, void *doit, void *dont )
@@ -736,7 +743,7 @@ void serv_got_im( struct gaim_connection *gc, char *handle, char *msg, guint32 f
/* If there's a newline/space in this string, split up there,
looks a bit prettier. */
- if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strchr( msg, ' ' ) ) )
+ if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strrchr( msg, ' ' ) ) )
{
msg[425] = tmp;
tmp = *nl;
@@ -768,7 +775,7 @@ void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout )
return;
if( ( u = user_findhandle( gc, handle ) ) )
- irc_msgfrom( gc->irc, u->nick, "\1TYPING 1\1" );
+ irc_privmsg( gc->irc, u, "PRIVMSG", gc->irc->nick, NULL, "\1TYPING 1\1" );
}
void serv_got_chat_left( struct gaim_connection *gc, int id )
diff --git a/protocols/proxy.c b/protocols/proxy.c
index 6d450c92..47ece91e 100644
--- a/protocols/proxy.c
+++ b/protocols/proxy.c
@@ -113,7 +113,7 @@ static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpoin
return TRUE;
}
-static void no_one_calls(gpointer data, gint source, GaimInputCondition cond)
+static void gaim_io_connected(gpointer data, gint source, GaimInputCondition cond)
{
struct PHB *phb = data;
unsigned int len;
@@ -162,7 +162,7 @@ static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb)
if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0) {
if (sockerr_again()) {
- phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, no_one_calls, phb);
+ phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, gaim_io_connected, phb);
phb->fd = fd;
} else {
closesocket(fd);
diff --git a/protocols/yahoo/crypt.c b/protocols/yahoo/crypt.c
index 00eed70b..5122e3af 100644
--- a/protocols/yahoo/crypt.c
+++ b/protocols/yahoo/crypt.c
@@ -22,10 +22,6 @@
* already had. isn't that lovely. people should just use linux or
* freebsd, crypt works properly on those systems. i hate solaris */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#if HAVE_STRING_H
# include <string.h>
#elif HAVE_STRINGS_H
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c
index 62ceb0af..c691f18b 100644
--- a/protocols/yahoo/libyahoo2.c
+++ b/protocols/yahoo/libyahoo2.c
@@ -43,10 +43,6 @@
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#ifndef _WIN32
#include <unistd.h>
#endif
diff --git a/protocols/yahoo/yahoo_httplib.c b/protocols/yahoo/yahoo_httplib.c
index 41e31a23..dbbe2a84 100644
--- a/protocols/yahoo/yahoo_httplib.c
+++ b/protocols/yahoo/yahoo_httplib.c
@@ -19,10 +19,6 @@
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <stdio.h>
#include <stdlib.h>
diff --git a/protocols/yahoo/yahoo_util.c b/protocols/yahoo/yahoo_util.c
index cb155e3c..3c99cf44 100644
--- a/protocols/yahoo/yahoo_util.c
+++ b/protocols/yahoo/yahoo_util.c
@@ -19,10 +19,6 @@
*
*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#if STDC_HEADERS
# include <string.h>
#else