Index: protocols/jabber/conference.c
===================================================================
--- protocols/jabber/conference.c	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/jabber/conference.c	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -174,4 +174,25 @@
 	
 	return 1;
+}
+
+void jabber_chat_invite( struct groupchat *c, char *who, char *message )
+{
+	struct xt_node *node;
+	struct im_connection *ic = c->ic;
+	struct jabber_chat *jc = c->data;
+
+	node = xt_new_node( "reason", message, NULL ); 
+
+	node = xt_new_node( "invite", NULL, node );
+	xt_add_attr( node, "to", who ); 
+
+	node = xt_new_node( "x", NULL, node ); 
+	xt_add_attr( node, "xmlns", XMLNS_MUC_USER ); 
+	
+	node = jabber_make_packet( "message", NULL, jc->name, node ); 
+
+	jabber_write_packet( ic, node ); 
+
+	xt_free_node( node );
 }
 
Index: protocols/jabber/io.c
===================================================================
--- protocols/jabber/io.c	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/jabber/io.c	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -120,5 +120,5 @@
 		return TRUE;
 	}
-	else if( st == 0 || ( st < 0 && !sockerr_again() ) )
+	else if( st == 0 || ( st < 0 && !ssl_sockerr_again( jd->ssl ) ) )
 	{
 		/* Set fd to -1 to make sure we won't write to it anymore. */
@@ -231,5 +231,5 @@
 		}
 	}
-	else if( st == 0 || ( st < 0 && !sockerr_again() ) )
+	else if( st == 0 || ( st < 0 && !ssl_sockerr_again( jd->ssl ) ) )
 	{
 		closesocket( jd->fd );
Index: protocols/jabber/iq.c
===================================================================
--- protocols/jabber/iq.c	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/jabber/iq.c	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -50,5 +50,6 @@
 	else if( strcmp( type, "get" ) == 0 )
 	{
-		if( !( c = xt_find_node( node->children, "query" ) ) ||
+		if( !( ( c = xt_find_node( node->children, "query" ) ) ||
+		       ( c = xt_find_node( node->children, "ping" ) ) ) || /* O_o WHAT is wrong with just <query/> ????? */
 		    !( s = xt_find_attr( c, "xmlns" ) ) )
 		{
@@ -81,4 +82,12 @@
 			xt_add_child( reply, xt_new_node( "tz", buf, NULL ) );
 		}
+		else if( strcmp( s, XMLNS_PING ) == 0 )
+		{
+			xt_free_node( reply );
+			reply = jabber_make_packet( "iq", "result", xt_find_attr( node, "from" ), NULL );
+			if( ( s = xt_find_attr( node, "id" ) ) )
+				xt_add_attr( reply, "id", s );
+			pack = 0;
+		}
 		else if( strcmp( s, XMLNS_DISCO_INFO ) == 0 )
 		{
@@ -87,4 +96,5 @@
 			                           XMLNS_CHATSTATES,
 			                           XMLNS_MUC,
+			                           XMLNS_PING,
 						   XMLNS_SI,
 						   XMLNS_BYTESTREAMS,
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/jabber/jabber.c	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -423,4 +423,18 @@
 }
 
+static void jabber_chat_invite_( struct groupchat *c, char *who, char *msg )
+{
+	struct jabber_chat *jc = c->data;
+	gchar *msg_alt = NULL;
+
+	if( msg == NULL )
+		msg_alt = g_strdup_printf( "%s invited you to %s", c->ic->acc->user, jc->name );
+	
+	if( c && who )
+		jabber_chat_invite( c, who, msg ? msg : msg_alt );
+	
+	g_free( msg_alt );
+}
+
 static void jabber_keepalive( struct im_connection *ic )
 {
@@ -494,5 +508,5 @@
 	ret->chat_msg = jabber_chat_msg_;
 	ret->chat_topic = jabber_chat_topic_;
-//	ret->chat_invite = jabber_chat_invite;
+	ret->chat_invite = jabber_chat_invite_;
 	ret->chat_leave = jabber_chat_leave_;
 	ret->chat_join = jabber_chat_join_;
Index: protocols/jabber/jabber.h
===================================================================
--- protocols/jabber/jabber.h	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/jabber/jabber.h	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -189,4 +189,5 @@
 #define XMLNS_VERSION      "jabber:iq:version"                                   /* XEP-0092 */
 #define XMLNS_TIME         "jabber:iq:time"                                      /* XEP-0090 */
+#define XMLNS_PING         "urn:xmpp:ping"                                       /* XEP-0199 */
 #define XMLNS_VCARD        "vcard-temp"                                          /* XEP-0054 */
 #define XMLNS_DELAY        "jabber:x:delay"                                      /* XEP-0091 */
@@ -293,4 +294,5 @@
 void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
 void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
+void jabber_chat_invite( struct groupchat *c, char *who, char *message );
 
 #endif
Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/msn/msn.c	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -241,5 +241,5 @@
 }
 
-static void msn_chat_invite( struct groupchat *c, char *msg, char *who )
+static void msn_chat_invite( struct groupchat *c, char *who, char *message )
 {
 	struct msn_switchboard *sb = msn_sb_by_chat( c );
Index: protocols/oscar/aim.h
===================================================================
--- protocols/oscar/aim.h	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/oscar/aim.h	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -94,5 +94,5 @@
  *
  */
-#define AIM_DEFAULT_LOGIN_SERVER "login.oscar.aol.com"
+#define AIM_DEFAULT_LOGIN_SERVER "login.messaging.aol.com"
 #define AIM_LOGIN_PORT 5190
 
Index: protocols/oscar/oscar.c
===================================================================
--- protocols/oscar/oscar.c	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/oscar/oscar.c	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -341,5 +341,5 @@
 	set_t *s;
 	
-	s = set_add( &acc->set, "server", NULL, set_eval_account, acc );
+	s = set_add( &acc->set, "server", AIM_DEFAULT_LOGIN_SERVER, set_eval_account, acc );
 	s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY;
 	
@@ -356,13 +356,5 @@
 	struct oscar_data *odata = ic->proto_data = g_new0(struct oscar_data, 1);
 
-	if (isdigit(acc->user[0])) {
-		odata->icq = TRUE;
-		/* This is odd but it's necessary for a proper do_import and do_export.
-		   We don't do those anymore, but let's stick with it, just in case
-		   it accidentally fixes something else too... </bitlbee> */
-		/* ic->acc->pass[8] = 0;
-		   Not touching this anymore now that it belongs to account_t!
-		   Let's hope nothing will break. ;-) */
-	} else {
+	if (!isdigit(acc->user[0])) {
 		ic->flags |= OPT_DOES_HTML;
 	}
@@ -385,15 +377,4 @@
 	}
 	
-	if (acc->server == NULL) {
-		imcb_error(ic, "No servername specified");
-		imc_logout(ic, FALSE);
-		return;
-	}
-	
-	if (g_strcasecmp(acc->server, "login.icq.com") != 0 &&
-	    g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) {
-		imcb_log(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
-	}
-	
 	imcb_log(ic, _("Signon: %s"), ic->acc->user);
 
@@ -402,5 +383,6 @@
 
 	conn->status |= AIM_CONN_STATUS_INPROGRESS;
-	conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, ic);
+	conn->fd = proxy_connect(set_getstr(&acc->set, "server"),
+	                         AIM_LOGIN_PORT, oscar_login_connect, ic);
 	if (conn->fd < 0) {
 		imcb_error(ic, _("Couldn't connect to host"));
@@ -2509,5 +2491,5 @@
 }
 
-void oscar_chat_invite(struct groupchat *c, char *message, char *who)
+void oscar_chat_invite(struct groupchat *c, char *who, char *message)
 {
 	struct im_connection *ic = c->ic;
Index: protocols/yahoo/yahoo.c
===================================================================
--- protocols/yahoo/yahoo.c	(revision dc0ba9c85539533349353713162f94077fb27be3)
+++ protocols/yahoo/yahoo.c	(revision eded1f703a8f5d2272b9d294d8e3dfb48fa302b4)
@@ -306,5 +306,5 @@
 }
 
-static void byahoo_chat_invite( struct groupchat *c, char *msg, char *who )
+static void byahoo_chat_invite( struct groupchat *c, char *who, char *msg )
 {
 	struct byahoo_data *yd = (struct byahoo_data *) c->ic->proto_data;
