changeset 7630:2df4d470c12a

[gaim-migrate @ 8254] i heart jabber committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 25 Nov 2003 06:56:44 +0000
parents 778624d3fced
children ea2d07ad05a9
files src/protocols/jabber/.todo src/protocols/jabber/JEPS src/protocols/jabber/auth.c src/protocols/jabber/jabber.c src/protocols/jabber/message.c src/protocols/jabber/presence.c
diffstat 6 files changed, 47 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/.todo	Tue Nov 25 05:26:17 2003 +0000
+++ b/src/protocols/jabber/.todo	Tue Nov 25 06:56:44 2003 +0000
@@ -3,39 +3,21 @@
     <note priority="high" time="1036043427">
         problem seeing buddies with long blist?
     </note>
-    <note priority="high" time="1036043971">
-        make password change take effect w/out restart
-    </note>
-    <note priority="high" time="1037635621">
-        some way to figure out which resource you are talking to
-    </note>
     <note priority="medium" time="1036044198">
         Browsing
     </note>
-    <note priority="medium" time="1036044216">
-        Bug: Opening/closing/reopening conferences (to the same "room"?) and changing conf. room nicks results in wrong nick reappearing (to other clients) and crash on close of conference dialog.
-    </note>
     <note priority="medium" time="1036044416">
         Server Admin operations (messages, etc.)
     </note>
     <note priority="medium" time="1036044448">
         Add option for user info to be published or not in JUD.
     </note>
-    <note priority="medium" time="1036044509">
-        Ability to "IM" conference room "buddies"
-    </note>
-    <note priority="medium" time="1036044563">
-        Some way to see/list roster items to which you have no subscription yourself?  Some way to delete them or subscribe to them if you want?
-    </note>
     <note priority="medium" time="1036044571">
         Show self on buddylist
     </note>
     <note priority="medium" time="1036044583">
         Delete server account.
     </note>
-    <note priority="medium" time="1036044871">
-        Messaging an "Away" Jabber user doesn't get an away message back?
-    </note>
     <note priority="medium" time="1036045649">
         Permit/Deny buddy support.
     </note>
@@ -45,15 +27,6 @@
     <note priority="medium" time="1036046413">
         a populate roster from local blist. most useful if you want to migrate a blist from one account to another, also useful if something freaky happens and the server blist is lost.
     </note>
-    <note priority="medium" time="1036046422">
-        conferencing needs straightening out in general
-        <note priority="medium" time="1036046528">
-            some s2s issues, maybe
-        </note>
-        <note priority="medium" time="1036046534">
-            join room 2x issues, maybe
-        </note>
-    </note>
     <note priority="medium" time="1037892911">
         info
         <note priority="medium" time="1037893000">
@@ -63,12 +36,6 @@
             have set info pre-fill values from the server when no local vcard exists. this will help people migrating to gaim
         </note>
     </note>
-    <note priority="low" time="1036046388" done="1063207934">
-        SSL support (priority 4 because its not really doable right now)
-        <comment>
-            faceprint added this
-        </comment>
-    </note>
     <note priority="verylow" time="1036043981">
         *sigh* file transfer (do we really need/want this?)
         <comment>
--- a/src/protocols/jabber/JEPS	Tue Nov 25 05:26:17 2003 +0000
+++ b/src/protocols/jabber/JEPS	Tue Nov 25 06:56:44 2003 +0000
@@ -1,54 +1,30 @@
 0004: NEED
 	Data Gathering and Reporting
-0012: DONE
-	Last Activity
-0018: DONE (Is it?)
-	Presence (Invisible)
-0022: DONE (replace?)
-	Message Events
-0030: DONE
-	Service Discovery
-0045: DONE
+0045: IN PROGRESS
 	Multi-User Chat
-0047: DONE
+0047: IN PROGRESS
 	In-Band Bytestreams
-0054: DONE (ugly)
-	vCard
 0060: NEED
 	Pub-Sub
-0065: DONE
+0065: IN PROGRESS
 	SOCKS5 Bytestreams
-0071: DONE (needs spec confirmation)
+0071: AWAITING FINAL SPEC
 	XHTML-IM
 0073: NEED
 	Basic IM Protocol Suite
-0077: DONE
-	In-Band Registration
-0078: DONE
-	Non-SASL Authentication
 0080: NEED (Do we?)
 	Geographic Location Information
-0082: DONE
-	Jabber Date and Time Profiles
 0084: NEED
 	User Avatars in Jabber
 0085: NEED
 	Chat State Notifications
-0086: DONE
-	Legacy Errors
 0089: WATCH
 	Generic Alerts
-0090: DONE
-	Entity Time
-0091: DONE
-	Delayed Delivery
-0092: DONE
-	Software Version
 0093: NEED
 	Roster Item Exchange
-0095: DONE
+0095: IN PROGRESS
 	Stream Initiation
-0096: DONE
+0096: IN PROGRESS
 	File Transfer Stream Initiation Profile
 0100: NEED
 	Gateway Interaction (Transports)
--- a/src/protocols/jabber/auth.c	Tue Nov 25 05:26:17 2003 +0000
+++ b/src/protocols/jabber/auth.c	Tue Nov 25 06:56:44 2003 +0000
@@ -43,7 +43,8 @@
 	gboolean digest_md5 = FALSE, plain=FALSE;
 
 	if((starttls = xmlnode_get_child(packet, "starttls"))) {
-		if(gaim_ssl_is_supported()) {
+		if(gaim_account_get_bool(js->gc->account, "use_tls", TRUE) &&
+						gaim_ssl_is_supported()) {
 			jabber_send_raw(js,
 					"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
 			return;
--- a/src/protocols/jabber/jabber.c	Tue Nov 25 05:26:17 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Tue Nov 25 06:56:44 2003 +0000
@@ -20,17 +20,6 @@
  */
 #include "internal.h"
 
-/*
-#include "conversation.h"
-#include "ft.h"
-#include "multi.h"
-#include "notify.h"
-#include "proxy.h"
-#include "request.h"
-#include "util.h"
-
-*/
-
 #include "account.h"
 #include "accountopt.h"
 #include "debug.h"
@@ -411,11 +400,15 @@
 
 	jabber_stream_set_state(js, JABBER_STREAM_CONNECTING);
 
-	if(gaim_account_get_bool(account, "old_ssl", FALSE)
-			&& gaim_ssl_is_supported()) {
-		js->gsc = gaim_ssl_connect(account, server,
-				gaim_account_get_int(account, "port", 5222),
-				jabber_login_callback_ssl, jabber_ssl_connect_failure, gc);
+
+	if(gaim_account_get_bool(account, "old_ssl", FALSE)) {
+		if(gaim_ssl_is_supported()) {
+			js->gsc = gaim_ssl_connect(account, server,
+					gaim_account_get_int(account, "port", 5222),
+					jabber_login_callback_ssl, jabber_ssl_connect_failure, gc);
+		} else {
+			gaim_connection_error(gc, _("SSL support unavailable"));
+		}
 	}
 
 	if(!js->gsc) {
@@ -705,11 +698,14 @@
 
 	jabber_stream_set_state(js, JABBER_STREAM_CONNECTING);
 
-	if(gaim_account_get_bool(account, "old_ssl", FALSE)
-			&& gaim_ssl_is_supported()) {
-		js->gsc = gaim_ssl_connect(account, server,
-				gaim_account_get_int(account, "port", 5222),
-				jabber_login_callback_ssl, NULL, gc);
+	if(gaim_account_get_bool(account, "old_ssl", FALSE)) {
+		if(gaim_ssl_is_supported()) {
+			js->gsc = gaim_ssl_connect(account, server,
+					gaim_account_get_int(account, "port", 5222),
+					jabber_login_callback_ssl, jabber_ssl_connect_failure, gc);
+		} else {
+			gaim_connection_error(gc, _("SSL support unavailable"));
+		}
 	}
 
 	if(!js->gsc) {
@@ -1146,7 +1142,12 @@
 	split = gaim_account_user_split_new(_("Resource"), "Gaim", '/');
 	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
 
-	option = gaim_account_option_bool_new(_("Force Old SSL"), "old_ssl", FALSE);
+	option = gaim_account_option_bool_new(_("Use TLS if available"), "use_tls",
+			TRUE);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+			option);
+
+	option = gaim_account_option_bool_new(_("Force old SSL"), "old_ssl", FALSE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
 			option);
 
--- a/src/protocols/jabber/message.c	Tue Nov 25 05:26:17 2003 +0000
+++ b/src/protocols/jabber/message.c	Tue Nov 25 06:56:44 2003 +0000
@@ -182,9 +182,16 @@
 		gaim_conv_chat_set_topic(GAIM_CONV_CHAT(chat->conv), jid->resource,
 				jm->subject);
 
-	if(jm->xhtml || jm->body)
-		serv_got_chat_in(jm->js->gc, chat->id, jid->resource,
-				0, jm->xhtml ? jm->xhtml : jm->body, jm->sent);
+	if(jm->xhtml || jm->body) {
+		if(jid->resource)
+			serv_got_chat_in(jm->js->gc, chat->id, jid->resource, 0,
+							jm->xhtml ? jm->xhtml : jm->body, jm->sent);
+		else if(chat->muc)
+			gaim_conv_chat_write(GAIM_CONV_CHAT(chat->conv), "",
+							jm->xhtml ? jm->xhtml : jm->body,
+							GAIM_MESSAGE_SYSTEM, jm->sent);
+	}
+
 	jabber_id_free(jid);
 }
 
--- a/src/protocols/jabber/presence.c	Tue Nov 25 05:26:17 2003 +0000
+++ b/src/protocols/jabber/presence.c	Tue Nov 25 06:56:44 2003 +0000
@@ -242,12 +242,17 @@
 						JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_SET,
 								"http://jabber.org/protocol/muc#owner");
 						xmlnode *query = xmlnode_get_child(iq->node, "query");
+						xmlnode *x = xmlnode_new_child(query, "x");
+						char *room_jid = g_strdup_printf("%s@%s", jid->node,
+										jid->domain);
 
-						xmlnode *x = xmlnode_new_child(query, "x");
+						xmlnode_set_attrib(iq->node, "to", room_jid);
 						xmlnode_set_attrib(x, "xmlns", "jabber:x:data");
 						xmlnode_set_attrib(x, "type", "submit");
 
 						jabber_iq_send(iq);
+
+						g_free(room_jid);
 					}
 				}
 			}