Index: bitlbee.c
===================================================================
--- bitlbee.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ bitlbee.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -165,5 +165,13 @@
 		return FALSE;
 	} 
-		
+	
+	/* Very naughty, go read the RFCs! >:) */
+	if( irc->readbuffer && ( strlen( irc->readbuffer ) > 1024 ) )
+	{
+		log_message( LOGLVL_ERROR, "Maximum line length exceeded." );
+		irc_free( irc );
+		return FALSE;
+	}
+	
 	return TRUE;
 }
Index: bitlbee.h
===================================================================
--- bitlbee.h	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ bitlbee.h	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -30,5 +30,5 @@
 
 #define PACKAGE "BitlBee"
-#define BITLBEE_VERSION "1.0pre"
+#define BITLBEE_VERSION "1.0"
 #define VERSION BITLBEE_VERSION
 
Index: configure
===================================================================
--- configure	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ configure	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -57,5 +57,4 @@
 --strip=0/1	Disable/enable binary stripping		$strip
 
---flood=0/1	Flood protection			$flood
 --ipv6=0/1	IPv6 socket support			$ipv6
 
@@ -287,5 +286,9 @@
 
 if [ "$flood" = 1 ]; then
-	echo '#define FLOOD_SEND' >> config.h
+	# echo '#define FLOOD_SEND' >> config.h
+	echo 'Flood protection is disabled in this release because of too many bugs.' 2> /dev/stderr
+	rm config.h
+	rm Makefile.settings
+	exit 1
 fi
 
@@ -345,15 +348,11 @@
 case "$arch" in
 Linux )
-	echo 'Linux.'
 ;;
 GNU/* )
-	echo 'Debian with non-Linux kernel?'
 ;;
 *BSD )
-	echo '*BSD.'
 	echo 'EFLAGS+=-liconv' >> Makefile.settings;
 ;;
 SunOS )
-	echo 'Solaris.'
 	echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
 	echo 'STRIP=\# skip strip' >> Makefile.settings
@@ -361,9 +360,7 @@
 ;;
 Darwin )
-	echo 'Darwin/Mac OS X.'
 	echo 'EFLAGS+=-liconv' >> Makefile.settings;
 ;;
 IRIX )
-	echo 'IRIX.'
 ;;
 CYGWIN* )
@@ -371,5 +368,6 @@
 ;;
 * )
-	echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV. Please report any problems to <wilmer@gaast.net>.'
+	echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.'
+	echo 'Please report any problems at http://bugs.bitlbee.org/.'
 ;;
 esac
@@ -394,9 +392,9 @@
 fi
 
-if [ "$flood" = "0" ]; then
-	echo '  Flood protection disabled.';
-else
-	echo '  Flood protection enabled.';
-fi
+#if [ "$flood" = "0" ]; then
+#	echo '  Flood protection disabled.';
+#else
+#	echo '  Flood protection enabled.';
+#fi
 
 if [ -n "$protocols" ]; then
Index: doc/AUTHORS
===================================================================
--- doc/AUTHORS	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ doc/AUTHORS	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -4,5 +4,5 @@
 	Main developer
 
-Jelmer 'ctrlsoft' Vernooij <jelmer@nl.linux.org>
+Jelmer 'ctrlsoft' Vernooij <jelmer@samba.org>
 	Documentation, general hacking, Win32 port
 
Index: doc/CHANGES
===================================================================
--- doc/CHANGES	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ doc/CHANGES	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -11,6 +11,24 @@
   handlers for headline messages (which allows you to use RSS-to-Jabber
   gateways).
-
-Finished ...
+- Lowered the line splitting limit a bit to fix data loss issues.
+- The $proto($handle) format used for messages specific to one IM-connection
+  now only include the ($handle) part when there's more than one $proto-
+  connection.
+- Fix for a crash-bug on broken Jabber/SSL connections.
+- Incoming typing notifications now also come in as CTCP TYPING messages, for
+  better consistency. Don't forget to update your scripts!
+- AIM typing notifications are supported now.
+- Jabber module only accepts ports 5220-5229 now, to prevent people from
+  abusing it as a port scanner. We aren't aware of any Jabber server that
+  runs on other ports than those. If you are, please warn us.
+- Send flood protection can't be enabled anymore. It was disabled by default
+  for a good reason for some time already, but some package maintainers
+  turned it back on while it's way too unreliable and trigger-happy to be
+  used.
+- Removed TODO file, the current to-do list is always in the on-line bug
+  tracking system.
+- Fixed a potential DoS bug in input handling.
+
+Finished 4 Dec 2005
 
 Version 0.99:
Index: doc/FAQ
===================================================================
--- doc/FAQ	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ doc/FAQ	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -39,21 +39,6 @@
 
 Q: When is $random_feature going to be implemented?
-A: Please do consult doc/TODO (preferably in a development snapshot, which
-   is more up-to-date than a TODO in a release version) before asking.
-   Please also check the documentation. You'd not be the first one to request
-   a feature which already exists!
-   
-   If your fabulous feature seems not to be requested before, just join
-   #bitlbee on irc.oftc.net and tell us the news.
-   
-   If your feature request is already in the TODO list, of course you can
-   still request it again/make us know that you'd like to see the feature as
-   well. But when the feature is in the "post-1.0" list, it's probably not
-   going to help. Most of the features in this list are low-priority because
-   we (the developers) don't need (or even want) them. (File transfers are a
-   good example here.)
-   Hence, they'll only be implemented when we really got too much spare
-   time. Obviously, if you're willing to help (i.e. submit a patch), you're
-   always welcome.
+A: It depends on the feature. We keep a list of all wishlist "bugs" in our
+   Bug Tracking system at http://bugs.bitlbee.org/
 
 Q: The messages I send and/or receive look weird. I see weird characters and
@@ -61,6 +46,9 @@
    non-ASCII characters!
 A: You probably have to change some settings. To get rid of HTML in messages,
-   see "help set html". If you seem to have problems with your charset, see
-   "help set charset".
+   see "help set strip_html". If you seem to have problems with your charset,
+   see "help set charset".
+   
+   Although actually most of these problems should be gone by now. So if you
+   can't get things to work well, you might have found a bug.
 
 Q: Is BitlBee forked from Gaim?
Index: doc/README
===================================================================
--- doc/README	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ doc/README	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -108,9 +108,8 @@
 See utils/bitlbeed.c for more information about the program.
 
-Just a little note: We run our public server im.bitlbee.org for a couple of
-months now, and so far we haven't experienced this problem yet. The only
-BitlBee processes killed because of CPU-time overuse were running for a long
-time already, they were usually killed during the MSN login process (which
-is quite CPU-time consuming).
+Just a little note: Now that we reach version 1.0, this shouldn't be that
+much of an issue anymore. However, on a public server, especially if you
+also use it for other things, it can't hurt to protect yourself against
+possible problems.
 
 
@@ -145,4 +144,10 @@
 You can find new releases of BitlBee at:
 http://www.bitlbee.org/
+
+The bug tracking system:
+http://bugs.bitlbee.org/
+
+Our version control system is Bazaar-NG. Our repository is at:
+http://code.bitlbee.org/
 
 
@@ -187,4 +192,4 @@
 	BitlBee - An IRC to other chat networks gateway 
 	          <http://www.bitlbee.org/>
-	Copyright (C) 2002-2004  Wilmer van der Gaast <wilmer@gaast.net>
+	Copyright (C) 2002-2005  Wilmer van der Gaast <wilmer@gaast.net>
 	                         and others
Index: c/TODO
===================================================================
--- doc/TODO	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ 	(revision )
@@ -1,40 +1,0 @@
-TODO for BitlBee:
-
-We're trying to keep a better TODO list now. The priorities here are somewhat
-random, maybe. Or at least they change from time to time. The "After 1.0"
-changes are very low-priority, the "Before 1.0" are "highest" priority, the
-others are changes we'll do when we feel like doing them. They're usually not
-as critical as the "Before 1.0" changes, but still a bit more important than
-"After 1.0".
-
-KNOWN BUGS TO FIX BEFORE 1.0:
-- 100% cpu usage bugs.
-  -> They're still there... :-(
-- Check if the IRC send flood protection is reliable now.
-  -> Probably not, at least it still causes troubles on logging in for some
-     people. Maybe the thresholds aren't okay yet. Logins are just floody,
-     nothing we can do about that.
-
-Some time: (mainly features)
-- Rewrite Jabber module - the current one sucks.
-- Test Yahoo! groupchats a bit better, because they still seem to be a bit
-  flakey.
-  -> There are bug reports from time to time, but we can't do much about
-     them, possibly it's more a libyahoo2 problem.
-- Groupchats
-  -> Make them work on other nets than MSN/Yahoo as well.
-- Make usernames case-insensitive. (On case-insensitive filesystems this
-  change isn't necessary. This one is going to suck with backward-compati-
-  bilty...)
-  -> We'll probably combine this with the introduction of a better file
-     format for userdata.
-- Remind the user of unanswered questions after some time.
-- Maybe a way to send global messages. (for server shutdowns, for example)
-- Away-auto-replies.
-- Allow nick changes.
-
-After 1.0: (mainly toys)
-- File transfers -> DCC
-- SSL support? Persistent connections? Things you can do with a bouncer/proxy.
-- Support for buddy groups.
-- What else?
Index: doc/user-guide/user-guide.xml
===================================================================
--- doc/user-guide/user-guide.xml	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ doc/user-guide/user-guide.xml	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -21,22 +21,11 @@
 
 	<legalnotice id="legalnotice">
-     <para>
-         Permission is granted to copy, distribute and/or modify this 
-         document under the terms of the <ulink type="help"
-         url="gnome-help:fdl"><citetitle>GNU Free Documentation 
-         License</citetitle></ulink>, Version 1.1 or any later version 
-         published by the Free Software Foundation with no Invariant 
-         Sections, no Front-Cover Texts, and no Back-Cover Texts. You 
-         may obtain a copy of the <citetitle>GNU Free Documentation 
-         License</citetitle> from the Free Software Foundation by 
-         visiting <ulink type="http" url="http://www.fsf.org">their 
-         Web site</ulink> or by writing to: Free Software Foundation, 
-         Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
-         USA.
-       </para>
     </legalnotice>
 
    <releaseinfo>
-   		This is the initial release of the BitlBee User Guide.
+   		This is the BitlBee User Guide. For now, the on-line help is
+		the most up-to-date documentation. Although this document shares
+		some parts with the on-line help system, other parts might be
+		very outdated.
    </releaseinfo>
 
Index: irc.c
===================================================================
--- irc.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ irc.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -1510,5 +1510,5 @@
 			{
 				irc_write( irc, ":%s!%s@%s %s %s :%s%s", u->nick, u->user, u->host,
-				           type, to, prefix, line );
+				           type, to, prefix ? prefix : "", line );
 			}
 			line = s + 1;
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ protocols/jabber/jabber.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -22,8 +22,4 @@
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #ifndef _WIN32
 #include <sys/utsname.h>
@@ -59,4 +55,6 @@
 #define DEFAULT_PORT 5222
 #define DEFAULT_PORT_SSL 5223
+#define JABBER_PORT_MIN 5220
+#define JABBER_PORT_MAX 5229
 
 #define JABBER_GROUP "Friends"
@@ -541,9 +539,4 @@
 	gjconn gjc;
 	
-	if (!g_slist_find(get_connections(), gc)) {
-		ssl_disconnect(source);
-		return;
-	}
-	
 	jd = gc->proto_data;
 	gjc = jd->gjc;
@@ -551,4 +544,9 @@
 	if (source == NULL) {
 		STATE_EVT(JCONN_STATE_OFF)
+		return;
+	}
+	
+	if (!g_slist_find(get_connections(), gc)) {
+		ssl_disconnect(source);
 		return;
 	}
@@ -589,4 +587,9 @@
 	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)
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ protocols/nogaim.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -452,5 +452,12 @@
 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" );
 }
 
@@ -737,5 +744,5 @@
 		/* 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;
@@ -769,5 +776,5 @@
 	
 	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" );
 }
 
Index: protocols/proxy.c
===================================================================
--- protocols/proxy.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ protocols/proxy.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -114,5 +114,5 @@
 }
 
-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;
@@ -163,5 +163,5 @@
 	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 {
Index: protocols/yahoo/crypt.c
===================================================================
--- protocols/yahoo/crypt.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ protocols/yahoo/crypt.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -22,8 +22,4 @@
  * 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
Index: protocols/yahoo/libyahoo2.c
===================================================================
--- protocols/yahoo/libyahoo2.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ protocols/yahoo/libyahoo2.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -43,8 +43,4 @@
  *
  */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
 
 #ifndef _WIN32
Index: protocols/yahoo/yahoo_httplib.c
===================================================================
--- protocols/yahoo/yahoo_httplib.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ protocols/yahoo/yahoo_httplib.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -19,8 +19,4 @@
  *
  */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
 
 #include <stdio.h>
Index: protocols/yahoo/yahoo_util.c
===================================================================
--- protocols/yahoo/yahoo_util.c	(revision 500a1b60d3dd0565d215721e0db7ec7da2dec2e0)
+++ protocols/yahoo/yahoo_util.c	(revision 019c031a8d77fa8f21792ccf0e07c2dfa058ce5f)
@@ -19,8 +19,4 @@
  *
  */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
 
 #if STDC_HEADERS
