From linuxwolf at jabber.org Sun Sep 1 00:10:35 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: jso/src/net/outer_planes/jso AbstractPacket.java Message-ID: <20020901051035.6609763D0B@hades.jabber.org> linuxwolf 02/09/01 00:10:35 Modified: src/net/outer_planes/jso AbstractPacket.java Log: - Updated attribute name "constants" to be more consistent with the rest of JSO Revision Changes Path 1.15 +4 -4 jso/src/net/outer_planes/jso/AbstractPacket.java Index: AbstractPacket.java =================================================================== RCS file: /home/cvs/jso/src/net/outer_planes/jso/AbstractPacket.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- AbstractPacket.java 1 Sep 2002 04:48:18 -0000 1.14 +++ AbstractPacket.java 1 Sep 2002 05:10:35 -0000 1.15 @@ -40,10 +40,10 @@ */ public abstract class AbstractPacket extends AbstractElement implements Packet { //"Constants" - public static final NSI ATTRIBUTE_TYPE = new NSI("type", ""); - public static final NSI ATTRIBUTE_ID = new NSI("id", ""); - public static final NSI ATTRIBUTE_FROM = new NSI("from", ""); - public static final NSI ATTRIBUTE_TO = new NSI("to", ""); + public static final NSI ATTRIBUTE_TYPE = new NSI("type", null); + public static final NSI ATTRIBUTE_ID = new NSI("id", null); + public static final NSI ATTRIBUTE_FROM = new NSI("from", null); + public static final NSI ATTRIBUTE_TO = new NSI("to", null); //Fields private StreamElement _Parent; From linuxwolf at jabber.org Sun Sep 1 02:09:17 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: jso/doc CHANGELOG Message-ID: <20020901070917.DD49D63D0B@hades.jabber.org> linuxwolf 02/09/01 02:09:17 Modified: doc CHANGELOG Log: - Updates for building to 0.2-PRE Revision Changes Path 1.3 +3 -0 jso/doc/CHANGELOG Index: CHANGELOG =================================================================== RCS file: /home/cvs/jso/doc/CHANGELOG,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CHANGELOG 31 Aug 2002 23:37:01 -0000 1.2 +++ CHANGELOG 1 Sep 2002 07:09:17 -0000 1.3 @@ -8,8 +8,11 @@ - Implemented Stream - Implemented StreamSource for Sockets - Implemented StreamSource for "arbitrary I/O" + - Enabled more global and accurate namespace support + - Changed Packet builders to understand "all attributes" - Added "example" demo/test application - Changed Extension "semantics to allow "primitive functionality" + - - (BUG) Modified PacketError impl to follow "XMPP CORE" spec 0.1.3-PRE2 (2002-08-07) From linuxwolf at jabber.org Sun Sep 1 02:09:19 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: jso/prj jso.ant-version.properties Message-ID: <20020901070919.38A3163D0B@hades.jabber.org> linuxwolf 02/09/01 02:09:19 Modified: prj jso.ant-version.properties Log: - Updates for building to 0.2-PRE Revision Changes Path 1.14 +1 -1 jso/prj/jso.ant-version.properties Index: jso.ant-version.properties =================================================================== RCS file: /home/cvs/jso/prj/jso.ant-version.properties,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- jso.ant-version.properties 1 Sep 2002 00:38:57 -0000 1.13 +++ jso.ant-version.properties 1 Sep 2002 07:09:19 -0000 1.14 @@ -1,2 +1,2 @@ # Sample ResourceBundle properties file -project.version=0.2 \ No newline at end of file +project.version=0.2-PRE \ No newline at end of file From linuxwolf at jabber.org Sun Sep 1 02:09:20 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: jso/src/net/outer_planes/jso InfoQueryPacket.java Message-ID: <20020901070920.A6B4D63D0B@hades.jabber.org> linuxwolf 02/09/01 02:09:20 Modified: src/net/outer_planes/jso InfoQueryPacket.java Log: - Updates for building to 0.2-PRE Revision Changes Path 1.5 +1 -1 jso/src/net/outer_planes/jso/InfoQueryPacket.java Index: InfoQueryPacket.java =================================================================== RCS file: /home/cvs/jso/src/net/outer_planes/jso/InfoQueryPacket.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- InfoQueryPacket.java 30 Aug 2002 06:36:06 -0000 1.4 +++ InfoQueryPacket.java 1 Sep 2002 07:09:20 -0000 1.5 @@ -83,7 +83,7 @@ throw new IllegalArgumentException("Name must be 'iq'"); super.setName(name); } - + /**

* Creates an "almost-exact" duplicate of this StreamNode, * using the given parent StreamElement. By "almost-exact", From stpeter at jabber.org Sun Sep 1 10:51:25 2002 From: stpeter at jabber.org (Peter Saint-Andre) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: JabberManual/adminguide - New directory Message-ID: <20020901155125.999DA63CFD@hades.jabber.org> stpeter 02/09/01 10:51:25 JabberManual/adminguide - New directory From stpeter at jabber.org Sun Sep 1 10:51:33 2002 From: stpeter at jabber.org (Peter Saint-Andre) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: JabberManual/techover - New directory Message-ID: <20020901155133.A96D963CFD@hades.jabber.org> stpeter 02/09/01 10:51:33 JabberManual/techover - New directory From stpeter at jabber.org Sun Sep 1 10:51:50 2002 From: stpeter at jabber.org (Peter Saint-Andre) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: JabberManual/userguide - New directory Message-ID: <20020901155150.7B01E63CFD@hades.jabber.org> stpeter 02/09/01 10:51:50 JabberManual/userguide - New directory From linuxwolf at jabber.org Sun Sep 1 13:07:19 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:48 2004 Subject: [cvslog] cvs commit: jso/www download.php faq.php index.php main.css status.php Message-ID: <20020901180719.AE72C63CFD@hades.jabber.org> linuxwolf 02/09/01 13:07:19 Modified: www download.php faq.php index.php main.css status.php Log: - Updated website (attempting to meet standards compliance) Revision Changes Path 1.9 +4 -2 jso/www/download.php Index: download.php =================================================================== RCS file: /home/cvs/jso/www/download.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- download.php 31 Aug 2002 02:00:10 -0000 1.8 +++ download.php 1 Sep 2002 18:07:19 -0000 1.9 @@ -4,7 +4,7 @@ function listFiles($title, $curr_path) { $base_path = "/var/projects/jso/files/"; $file_path = "$base_path/$curr_path"; - $file_handle = opendir($file_path); + $file_handle = opendir($file_path); $file_idx = 0; ?>

@@ -40,7 +40,9 @@

-

What is JSO?

-JSO is an acronym for "JABBER(tm) Stream Objects", and is a library (for Java) to develop other JABBER/XMPP tools. -

-

-

Is JSO meant to replace JabberBeans?

-No. JSO is a fairly "low-level" library, in that it provides an object model and some XML-stream logic. -It does not "hide" the details of JABBER/XMPP from the developer. -

+JSO (an acronym for "JABBER(tm) Stream Objects") is a library (for Java) to develop other JABBER/XMPP tools.

-

What version of Java does JSO work with?

+

JSO is only known to work with Java 2 Standard Edition (J2SE) version 1.4. A number of "special features" from -this version of J2SE are utilized, most notably "nested exceptions". -

+this version of J2SE are utilized, most notably "nested exceptions".

+ +

Who should use JSO?

+

+Any developers that wish to build Jabber applications in Java, such as clients (user clients, bots, etc.), +components, or even stand-alone servers.

+ +

Is JSO meant to replace JabberBeans (or EchoMuse, or ...)?

+

+Not really. JSO is a "low-level" library, in that it provides a "core" object model and some XML-stream logic. +It does not "hide" the details of JABBER/XMPP from the developer.

+ +

How is JSO licensed?

+

+JSO is licensed under the terms of the JABBER Open-Source License (JOSL). A copy of this license can be obtained +from either the Open Source Initiative or +Jabber, Inc..

+ +

Can I use JSO to communicate with "jabberd" (or JCP, or Tipic, or ...)?

+

+Yes. As long as a "stream" of XML is available (in both directions), communications are possible with the existing +servers.

1.7 +29 -30 jso/www/index.php Index: index.php =================================================================== RCS file: /home/cvs/jso/www/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- index.php 16 Aug 2002 21:56:26 -0000 1.6 +++ index.php 1 Sep 2002 18:07:19 -0000 1.7 @@ -6,7 +6,7 @@ if ($current != $url) { $link_html = "$name"; } else { - $link_html = "$name"; + $link_html = "
$name
"; } return $link_html; @@ -21,37 +21,36 @@ include "${current}.php"; ?> - - -JSO :: <? echo ${subtitle} ?> - - - - -
-
- - - - - -
- - -
JSO
- + + + JSO :: <? echo ${subtitle} ?> + + + + +
+

JSO ::

+
+ +
+

JSO © 2002, Matthew "Linuxwolf" Miller. All rights reserved under the terms of the JOSL

Jabber™ is a registered trademark of Jabber, Inc.

+ + - - + + + 1.7 +99 -164 jso/www/main.css Index: main.css =================================================================== RCS file: /home/cvs/jso/www/main.css,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- main.css 5 Aug 2002 16:18:26 -0000 1.6 +++ main.css 1 Sep 2002 18:07:19 -0000 1.7 @@ -1,197 +1,69 @@ body { - background-color: #000033; - font-family: tahoma,arial,helvetica,sans-serif; + background-color: #ffffff; + font-family: tahoma,arial,helvetica; + font-size: 8pt; } -h1 { - font-size: 16pt; - font-weight: bold; - margin: 0px; +a { + border-color:transparent; + border-style:solid; + border-width:1px 0px; + text-decoration:none; } -h2 { - font-size: 16pt; - font-weight: bold; - - margin: 0px; -} -p { - margin: 0px; -} - -.logo { - background-color: #cccccc; - - border-color: #000066; - border-style: solid; - border-width: 1px; +a:hover { + color:#0000ff; + border-color:#0000ff; } - -.border { - border-color: #ffffff; - border-style: solid; - border-width: 2px; - - margin: 12px; - padding: 4px; -} - -.titlebar { - border-color: #000066; - border-style: solid; - border-width: 0px 0px 4px 0px; - - padding: .1em; -} - -.titlebar .title { - font-size: 28pt; - font-weight: bold; - - color: #000066; - - text-align: left; - vertical-align: top; - - width: 50%; -} -.titlebar .subtitle { - font-size: 16pt; - font-weight: bold; - - color: #999999; - - text-align: right; - vertical-align: bottom; -} - -.linkbar { - font-size: 8pt; -} -.linkbar table { - border-color: #000066; - border-style: solid; - border-width: 1px; - - padding: 4px; - - width: 100%; - height: 100%; -} -.linkbar td { - vertical-align: middle; - - padding: 0px; -} -.linkbar .active { - font-weight: bold; -} -.linkbar a { - display: block; - - border-color: transparent; - border-style: solid; - border-width: 1px; - - color: #000066; - - text-decoration: none; - - width: 100%; - padding: 0px 4px; -} -.linkbar a:hover { - border-color: #666666; - border-style: solid; - border-width: 1px; - - background-color: #cccccc; - color: #ffffff; - - text-decoration: none; +a:visited:hover { + color:#ff0000; + border-color:#ff0000; } -.content { - background-color: #ffffff; +.header { + color:#ffffff; + border-bottom:#000066 solid 8px; - border-color: #999999; - border-style: solid; - border-width: 1px; - - margin: 0px; - padding: 4px 8px; -} -.content h1 { - background-color: #cccccc; - color: #000066; - - border-color: #666666; - border-style: solid; - border-width: 1px; - - padding: .1em .2em; + margin:0px 0px 0px 240px; + padding:0px; } -.content h2 { - color: #000066; - - padding: .1em 0em .1em 0em; -} -.content p { - padding: 1em 0em; -} - -.subject { - padding: 4px; - - width: 100%; - - vertical-align: top; -} - -.tagline { - color: #cccccc; - - border-color: #999999; - border-style: solid; - border-width: 1px; - - font-size: 8pt; - font-weight: bold; - - text-align: center; - - margin: 8px 0px 0px 0px; - padding: 4px 8px; +.header h1 { + color:#000066; + + font-size:24pt; + margin:0px; + padding:0px 8px; } .list { - border: 1px #000099 solid; + border: #666666 solid 1px; } .list td,th { padding: 2px; } .list .first-col { + border-left: 1px #666666 solid; + border-right: 1px #cccccc solid; +} +.list .center-col { + border-right: 1px #cccccc solid; border-right: 1px #cccccc solid; } .list .last-col { border-left: 1px #cccccc solid; + border-right: 1px #666666 solid; } .list-lt-grey { -background-color: #f0f0f0; -/*border:1px #000000 solid;*/ -/*padding:5px;*/ + background-color: #f0f0f0; } .list-dk-grey { -background-color: #e0e0e0; -/*border:1px #000000 solid;*/ -/*padding:5px;*/ + background-color: #e0e0e0; } .list-title { - background-color: #000099; - border: 1px #000000 solid; + background-color: #ffffff; padding: 2px; - color: #ffffff; + color: #000099; font-size: 12pt; font-weight: bold; } @@ -201,4 +73,67 @@ color: #ffffff; font-size: 10pt; font-weight: bold; +} +.tagline { + color: #666666; + + font-size: 6pt; + font-weight: bold; + + text-align: center; + + margin: 16px 0px 0px 240px; + padding: 4px 8px; +} +.tagline p { + margin: 0px; + padding: 0px; +} + +.navigation { + position:absolute; + top:16px; + left:16px; + width:200px; + margin:0px; + padding:4px; +} +.navigation a { + color:#000000; + border-width:1px; + display:block; + width:100%; + padding:0px 0px 0px 12px; +} +.navigation a:hover { + color:#0000ff; + background-color:#ccccff; + + font-weight:bold; +} +.navigation a:visited:hover { + color:#ff0000; + background-color:#ffcccc; + + font-weight:bold; +} +.navigation h2 { + color:#333333; + border-color:#000000; + border-style:solid; + border-width:0px 0px 2px 0px; + font-weight:bold; + font-size:12pt; + margin:8px 0px 4px 0px; +} + +.content { + background-color: #ececec; + border: #999999 solid 1px; + margin:16px 0px 0px 240px; + padding:8px; +} +.content h2 { + border-bottom: #000033 solid 1px; + color: #000033; } 1.6 +4 -4 jso/www/status.php Index: status.php =================================================================== RCS file: /home/cvs/jso/www/status.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- status.php 22 Aug 2002 15:56:29 -0000 1.5 +++ status.php 1 Sep 2002 18:07:19 -0000 1.6 @@ -11,7 +11,7 @@

Project Road-Map

-

JSO © 2002, Matthew "Linuxwolf" Miller. All rights reserved under the terms of the JOSL

-

Jabber™ is a registered trademark of Jabber, Inc.

+

JSO © 2002, Matthew "Linuxwolf" Miller. All rights reserved under the terms of the JOSL

+

Jabber™ is a registered trademark of Jabber, Inc.

From pcurtis at jabber.org Mon Sep 2 15:24:15 2002 From: pcurtis at jabber.org (Paul Curtis) Date: Fri Jul 9 09:52:51 2004 Subject: [cvslog] cvs commit: yahoo-transport-2 yahoo-server.c Message-ID: <20020902202415.CC3AE63CFD@hades.jabber.org> pcurtis 02/09/02 15:24:15 Modified: . yahoo-server.c Log: Added the correct unsubscribe for the transport so that the transport is removed from the roster. Revision Changes Path 1.11 +9 -1 yahoo-transport-2/yahoo-server.c Index: yahoo-server.c =================================================================== RCS file: /home/cvs/yahoo-transport-2/yahoo-server.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- yahoo-server.c 31 Aug 2002 23:47:02 -0000 1.10 +++ yahoo-server.c 2 Sep 2002 20:24:15 -0000 1.11 @@ -20,7 +20,7 @@ along with the Yahoo! Transport; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - $Id: yahoo-server.c,v 1.10 2002/08/31 23:47:02 pcurtis Exp $ + $Id: yahoo-server.c,v 1.11 2002/09/02 20:24:15 pcurtis Exp $ */ #include "yahoo-transport.h" @@ -97,6 +97,14 @@ yahoo_transport_presence_offline(yd); yahoo_close(yd); } + p = xmlnode_new_tag("presence"); + jnew = jid_new(xmlnode_pool(p), yi->i->id); + jid_set(jnew, "registered", JID_RESOURCE); + xmlnode_put_attrib(p, "to", jid_full(jp->from)); + xmlnode_put_attrib(p, "from", jid_full(jnew)); + xmlnode_put_attrib(p, "type", "unsubscribe"); + deliver(dpacket_new(p), NULL); + jutil_iqresult(jp->x); query = xmlnode_insert_tag(jp->x, "query"); xmlnode_put_attrib(query,"xmlns",NS_REGISTER); From pcurtis at jabber.org Mon Sep 2 20:07:41 2002 From: pcurtis at jabber.org (Paul Curtis) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: yahoo-transport-2 yahoo-phandler.c yahoo-presence.c yahoo-server.c yahoo-session.c yahoo-transport.h Message-ID: <20020903010741.9A04E63CFD@hades.jabber.org> pcurtis 02/09/02 20:07:41 Modified: . yahoo-phandler.c yahoo-presence.c yahoo-server.c yahoo-session.c yahoo-transport.h Log: Finshed testing and checking the "Remove" code. Cleaned up the unregister functions, and added code to "unsubscribe" transport contacts from the roster Revision Changes Path 1.16 +36 -25 yahoo-transport-2/yahoo-phandler.c Index: yahoo-phandler.c =================================================================== RCS file: /home/cvs/yahoo-transport-2/yahoo-phandler.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- yahoo-phandler.c 28 Aug 2002 13:48:15 -0000 1.15 +++ yahoo-phandler.c 3 Sep 2002 01:07:41 -0000 1.16 @@ -20,17 +20,12 @@ along with the Yahoo! Transport; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - $Id: yahoo-phandler.c,v 1.15 2002/08/28 13:48:15 pcurtis Exp $ + $Id: yahoo-phandler.c,v 1.16 2002/09/03 01:07:41 pcurtis Exp $ */ #include "yahoo-transport.h" - - - - - - +/* Used for initial debugging void _yahoo_walk_hash(xht ht, const char *key, void *data, void *arg) { log_debug(ZONE, "[YAHOO]: Key = '%s'", key); } @@ -41,14 +36,7 @@ xhash_walk(hash, _yahoo_walk_hash, NULL); log_debug(ZONE, "[YAHOO]: -------------------------"); } - - - - - - - - +*/ unsigned char *UTF8_to_str(pool p, unsigned char *in, const char *charmap) { char *tmp = NULL, *tmp2 = NULL; @@ -91,7 +79,7 @@ char *buffer; int i; - if (yahoo_get_session_connection_state(jp) == 3) { + if (yahoo_get_session_connection_state(jp) == YAHOO_NOT_REGISTERED) { if (yahoo_get_registration_required(jp)) { jutil_error(jp->x, TERROR_REGISTER); deliver(dpacket_new(jp->x), NULL); @@ -100,7 +88,8 @@ } i = 0; - while ((yahoo_get_session_connection_state(jp) != 0) && (i < yi->timeout)) { + while ((yahoo_get_session_connection_state(jp) != YAHOO_CONNECTED) + && (i < yi->timeout)) { pth_usleep(yi->timer_interval * 1000); i++; } @@ -194,7 +183,7 @@ log_debug(ZONE, "[YAHOO]: Adding '%s' to group '%s'", jp->to->user, "Buddies"); xhash_put(yd->contacts, jp->to->user, (void *)"Buddies"); - _yahoo_get_hash(yd->contacts, "contacts -- add buddy"); +// _yahoo_get_hash(yd->contacts, "contacts -- add buddy"); yahoo_add_buddy(yd, jp->to->user, "Buddies"); x = jutil_presnew(JPACKET__SUBSCRIBED, jid_full(jp->from), NULL); jutil_tofrom(x); @@ -205,14 +194,14 @@ case JPACKET__UNSUBSCRIBE: - _yahoo_get_hash(yd->contacts, "contacts -- remove buddy"); +// _yahoo_get_hash(yd->contacts, "contacts -- remove buddy"); buffer = (char *)xhash_get(yd->contacts, jp->to->user); if (buffer != NULL) { log_debug(ZONE, "[YAHOO]: Removing '%s' from group '%s'", jp->to->user, buffer); yahoo_remove_buddy(yd, jp->to->user, buffer); xhash_zap(yd->contacts, jp->to->user); - _yahoo_get_hash(yd->contacts, "contacts -- remove buddy, after zap"); +// _yahoo_get_hash(yd->contacts, "contacts -- remove buddy, after zap"); } break; @@ -249,10 +238,11 @@ yahoo_instance yi = (yahoo_instance)jp->aux1; struct yahoo_data *yd = NULL; + yi->stats->packets_in++; /* All error packets are returned */ - if(jpacket_subtype(jp) == JPACKET__ERROR) { + if (jpacket_subtype(jp) == JPACKET__ERROR) { xmlnode_free(jp->x); return; } @@ -260,7 +250,8 @@ /* If a presence packet is sent from the client, we do not have to handle it as the transport handles the presence to Yahoo. Meaning: Yahoo does not want - a presence from all of your Yahoo contacts. Yahoo wants one presence from *you* + a presence from all of your Yahoo contacts. Yahoo wants one presence from + *you* */ if ((jp->type == JPACKET_PRESENCE) && (jp->to->user != NULL)) { xmlnode_free(jp->x); @@ -268,8 +259,8 @@ } /* - Normally, subscribe/unsubscribe & chat/message packets directly to the transport - are meaningless. We do not handle them, and pass them off + Normally, subscribe/unsubscribe & chat/message packets directly to the + transport are meaningless. We do not handle them, and pass them off */ if ((jp->type == JPACKET_S10N) && (jp->to->user == NULL)) { xmlnode_free(jp->x); @@ -280,7 +271,6 @@ log_debug(ZONE, "[YAHOO] Packet to '%s'", jid_full(jp->to)); log_debug(ZONE, "[YAHOO] Packet from '%s'", jid_full(jp->from)); - yi->stats->packets_in++; /* All IQ packets are handled at the server level, not the user level, so @@ -290,6 +280,27 @@ yahoo_transport_packets(jp); return; } + + +/* + There is one more type of packet the transport receives, and + basically does nothing with. If the client sends an "unsubscribed" + packet to us, we just acknowledge it. +*/ + + if ((jp->type == JPACKET_S10N) && (jp->subtype == JPACKET__UNSUBSCRIBED)) { + jutil_tofrom(jp->x); + jpacket_reset(jp); + deliver(dpacket_new(jp->x), NULL); + return; + } + +/* At this point, all packets not handled above will require the user + to have a 'session'. In addition, the session may establish a + connection to Yahoo, IF the user has registered with the transport. + If he has not, the transport will send a 'registration required' + error to the client. +*/ if (yahoo_get_session("initial-check", jp, yi) == NULL) yahoo_new_session("initial-check", jp, yi); 1.8 +23 -1 yahoo-transport-2/yahoo-presence.c Index: yahoo-presence.c =================================================================== RCS file: /home/cvs/yahoo-transport-2/yahoo-presence.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- yahoo-presence.c 31 Aug 2002 23:47:02 -0000 1.7 +++ yahoo-presence.c 3 Sep 2002 01:07:41 -0000 1.8 @@ -20,7 +20,7 @@ along with the Yahoo! Transport; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - $Id: yahoo-presence.c,v 1.7 2002/08/31 23:47:02 pcurtis Exp $ + $Id: yahoo-presence.c,v 1.8 2002/09/03 01:07:41 pcurtis Exp $ */ #include "yahoo-transport.h" @@ -93,4 +93,26 @@ xmlnode_put_attrib(x, "from", spools(x->p, yd->yi->i->id, "/registered", x->p)); xmlnode_insert_cdata(xmlnode_insert_tag(x, "status"), "Connected", -1); deliver(dpacket_new(x), NULL); +} + + +void yahoo_unsubscribe_contact(xht ht, const char *key, void *data, void *arg) { + xmlnode x; + struct yahoo_data *yd = (struct yahoo_data *)arg; + pool p; + + p = pool_new(); + yd->yi->stats->packets_out++; + + log_debug(ZONE, "[YAHOO]: Unsubscribing '%s'", key); + x = jutil_presnew(JPACKET__UNSUBSCRIBE, jid_full(yd->me), NULL); + xmlnode_put_attrib(x, "from", spools(p, key, "@", yd->yi->i->id, p)); +// x = jutil_presnew(JPACKET__UNSUBSCRIBE, spools(p, key, "@", yd->yi->i->id, p), NULL); +// xmlnode_put_attrib(x, "from", jid_full(yd->me)); + deliver(dpacket_new(x), NULL); + pool_free(p); +} + +void yahoo_unsubscribe_contacts(struct yahoo_data *yd) { + xhash_walk(yd->contacts, yahoo_unsubscribe_contact, (void *)yd); } 1.12 +8 -1 yahoo-transport-2/yahoo-server.c Index: yahoo-server.c =================================================================== RCS file: /home/cvs/yahoo-transport-2/yahoo-server.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- yahoo-server.c 2 Sep 2002 20:24:15 -0000 1.11 +++ yahoo-server.c 3 Sep 2002 01:07:41 -0000 1.12 @@ -20,7 +20,7 @@ along with the Yahoo! Transport; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - $Id: yahoo-server.c,v 1.11 2002/09/02 20:24:15 pcurtis Exp $ + $Id: yahoo-server.c,v 1.12 2002/09/03 01:07:41 pcurtis Exp $ */ #include "yahoo-transport.h" @@ -94,6 +94,7 @@ yd = yahoo_get_session("unregister", jp, yi); if (yd) { + yahoo_unsubscribe_contacts(yd); yahoo_transport_presence_offline(yd); yahoo_close(yd); } @@ -123,6 +124,12 @@ xmlnode_put_attrib(p, "type", "subscribe"); deliver(dpacket_new(p), NULL); + + yd = yahoo_get_session("register", jp, yi); + if (yd) { + yahoo_remove_session(jp, yi); + yahoo_new_session("register", jp, yi); + } jutil_iqresult(jp->x); query = xmlnode_insert_tag(jp->x, "query"); xmlnode_put_attrib(query,"xmlns",NS_REGISTER); 1.11 +5 -5 yahoo-transport-2/yahoo-session.c Index: yahoo-session.c =================================================================== RCS file: /home/cvs/yahoo-transport-2/yahoo-session.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- yahoo-session.c 31 Aug 2002 23:47:02 -0000 1.10 +++ yahoo-session.c 3 Sep 2002 01:07:41 -0000 1.11 @@ -20,7 +20,7 @@ along with the Yahoo! Transport; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - $Id: yahoo-session.c,v 1.10 2002/08/31 23:47:02 pcurtis Exp $ + $Id: yahoo-session.c,v 1.11 2002/09/03 01:07:41 pcurtis Exp $ */ #include "yahoo-transport.h" @@ -48,7 +48,7 @@ yd->username = xmlnode_get_data(xmlnode_get_tag(x, "username")); yd->password = xmlnode_get_data(xmlnode_get_tag(x, "password")); yd->me = jid_new(yi->i->p, jid_full(jp->from)); - yd->connection_state = 2; + yd->connection_state = YAHOO_NEW_SESSION; yd->yi = yi; yd->registration_required = 0; yd->p = pool_new(); @@ -58,7 +58,7 @@ xhash_put(yi->user, yd->session_key, (void *)yd); if ((yd->username != NULL) && (yd->password != NULL)) { - yd->connection_state = 1; + yd->connection_state = YAHOO_CONNECTING; xhash_put(yi->user, j_strdup(jid_full(u)), (void *)yd); pth_mutex_release(&yi->lock); log_debug(ZONE, "[YAHOO]: New connection to '%s:%d' for '%s'", @@ -66,7 +66,7 @@ mio_connect(yi->server, yi->port, yahoo_pending, (void*)yd, 30, MIO_CONNECT_RAW); } else { yd->registration_required = 1; - yd->connection_state = 3; + yd->connection_state = YAHOO_NOT_REGISTERED; xhash_put(yi->user, j_strdup(jid_full(u)), (void *)yd); } log_debug(ZONE, "[YAHOO]: New session for '%s' from '%s'", yd->session_key, who); @@ -140,7 +140,7 @@ yd->connection_state = state; xhash_put(yd->yi->user, yd->session_key, (void *)yd); pth_mutex_release(&yd->yi->lock); - if (yd->connection_state == 0) + if (yd->connection_state == YAHOO_CONNECTED) yahoo_transport_presence_online(yd); else yahoo_transport_presence_offline(yd); 1.10 +8 -1 yahoo-transport-2/yahoo-transport.h Index: yahoo-transport.h =================================================================== RCS file: /home/cvs/yahoo-transport-2/yahoo-transport.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- yahoo-transport.h 31 Aug 2002 23:47:02 -0000 1.9 +++ yahoo-transport.h 3 Sep 2002 01:07:41 -0000 1.10 @@ -89,6 +89,12 @@ } _yahoo_instance, *yahoo_instance; +#define YAHOO_CONNECTED 0 +#define YAHOO_CONNECTING 1 +#define YAHOO_NEW_SESSION 2 +#define YAHOO_NOT_REGISTERED 3 +#define YAHOO_UNREGISTER 4 + /* Yahoo! User structure. There is one of these structures per current users of the transport. Each user's structure is stored in a hash that is maintained by the instance. @@ -210,4 +216,5 @@ void yahoo_transport_presence_offline(struct yahoo_data *yd); void yahoo_transport_presence_online(struct yahoo_data *yd); void yahoo_stats(jpacket jp); -void _yahoo_get_hash(xht hash, char *what); +// void _yahoo_get_hash(xht hash, char *what); +void yahoo_unsubscribe_contacts(struct yahoo_data *); From linuxwolf at jabber.org Tue Sep 3 10:35:08 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: jso/www download.php Message-ID: <20020903153508.3B7CF63CFD@hades.jabber.org> linuxwolf 02/09/03 10:35:08 Modified: www download.php Log: - Minor cosmetic update to website Revision Changes Path 1.11 +1 -0 jso/www/download.php Index: download.php =================================================================== RCS file: /home/cvs/jso/www/download.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- download.php 2 Sep 2002 16:13:25 -0000 1.10 +++ download.php 3 Sep 2002 15:35:08 -0000 1.11 @@ -50,6 +50,7 @@ function display() { listFiles("Stable Releases", ""); +?>
 
From linuxwolf at jabber.org Tue Sep 3 11:36:06 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: jso/prj jso.ant-version.properties Message-ID: <20020903163606.D186263CFD@hades.jabber.org> linuxwolf 02/09/03 11:36:06 Modified: prj jso.ant-version.properties Log: - Updated version to reflect (continued) development Revision Changes Path 1.15 +1 -1 jso/prj/jso.ant-version.properties Index: jso.ant-version.properties =================================================================== RCS file: /home/cvs/jso/prj/jso.ant-version.properties,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- jso.ant-version.properties 1 Sep 2002 07:09:19 -0000 1.14 +++ jso.ant-version.properties 3 Sep 2002 16:36:06 -0000 1.15 @@ -1,2 +1,2 @@ # Sample ResourceBundle properties file -project.version=0.2-PRE \ No newline at end of file +project.version=0.3-DEV-${project.timestamp} \ No newline at end of file From dlb at jabber.org Tue Sep 3 12:26:47 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: FML - Imported sources Message-ID: <20020903172647.D7AE163CFD@hades.jabber.org> dlb 02/09/03 12:26:47 Log: FML is the base directory of the Flash Messaging Libraries Status: Vendor Tag: Vendor-1 Release Tags: Release-1 No conflicts created by this import From dlb at jabber.org Tue Sep 3 16:21:08 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: FML - Imported sources Message-ID: <20020903212108.306CD63D1A@hades.jabber.org> dlb 02/09/03 16:21:08 Log: FML is the base directory of the Flash Messaging Libraries project Status: Vendor Tag: maintainer Release Tags: beta N FML/testfile.txt cvs: ERROR: cannot write file /home/cvs//FML/testfile.txt,v: Permission denied No conflicts created by this import From dlb at jabber.org Tue Sep 3 16:22:04 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: FML - Imported sources Message-ID: <20020903212204.351FA63D52@hades.jabber.org> dlb 02/09/03 16:22:04 Log: FML is the base directory of the Flash Messaging Libraries project Status: Vendor Tag: maintainer Release Tags: beta N FML/testfile.txt cvs: ERROR: cannot write file /home/cvs/FML/testfile.txt,v: Permission denied No conflicts created by this import From dlb at jabber.org Tue Sep 3 16:28:29 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: FML - Imported sources Message-ID: <20020903212829.8F56763D1A@hades.jabber.org> dlb 02/09/03 16:28:29 Log: FML is the base directory of the Flash Messaging Libraries project Status: Vendor Tag: maintainer Release Tags: beta N FML/testfile.txt No conflicts created by this import From linuxwolf at jabber.org Tue Sep 3 20:05:02 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: jso/doc CHANGELOG Message-ID: <20020904010502.1448263D1A@hades.jabber.org> linuxwolf 02/09/03 20:05:02 Modified: doc Tag: RLS-0_2 CHANGELOG Log: - Fixed bug with generating jso-api.jar Revision Changes Path No revision No revision 1.3.2.2 +5 -2 jso/doc/CHANGELOG Index: CHANGELOG =================================================================== RCS file: /home/cvs/jso/doc/CHANGELOG,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- CHANGELOG 2 Sep 2002 17:11:46 -0000 1.3.2.1 +++ CHANGELOG 4 Sep 2002 01:05:01 -0000 1.3.2.2 @@ -1,6 +1,10 @@ JSO Release Changes ----------------------------------------------------------- +0.2-PRE3 (2002-09-03) +========== + - (BUG) Fixed generation of jso-api.jar to actually include classes + 0.2-PRE2 (2002-09-02) ========== - Added method to obtain JSOImplementation from Stream @@ -15,8 +19,7 @@ - Enabled more global and accurate namespace support - Changed Packet builders to understand "all attributes" - Added "example" demo/test application - - Changed Extension "semantics to allow "primitive functionality" - - + - Changed Extension "semantics" to allow "primitive functionality" - (BUG) Modified PacketError impl to follow "XMPP CORE" spec 0.1.3-PRE2 (2002-08-07) From linuxwolf at jabber.org Tue Sep 3 20:05:03 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: jso/prj jso-api.build.xml jso.ant-version.properties Message-ID: <20020904010503.63EE163D1A@hades.jabber.org> linuxwolf 02/09/03 20:05:03 Modified: prj Tag: RLS-0_2 jso-api.build.xml jso.ant-version.properties Log: - Fixed bug with generating jso-api.jar Revision Changes Path No revision No revision 1.7.4.1 +1 -1 jso/prj/jso-api.build.xml Index: jso-api.build.xml =================================================================== RCS file: /home/cvs/jso/prj/jso-api.build.xml,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -u -r1.7 -r1.7.4.1 --- jso-api.build.xml 10 Jul 2002 17:05:02 -0000 1.7 +++ jso-api.build.xml 4 Sep 2002 01:05:03 -0000 1.7.4.1 @@ -10,7 +10,7 @@ - + 1.14.2.2 +1 -1 jso/prj/jso.ant-version.properties Index: jso.ant-version.properties =================================================================== RCS file: /home/cvs/jso/prj/jso.ant-version.properties,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -u -r1.14.2.1 -r1.14.2.2 --- jso.ant-version.properties 2 Sep 2002 17:11:47 -0000 1.14.2.1 +++ jso.ant-version.properties 4 Sep 2002 01:05:03 -0000 1.14.2.2 @@ -1,2 +1,2 @@ # Sample ResourceBundle properties file -project.version=0.2-PRE2 \ No newline at end of file +project.version=0.2-PRE3 \ No newline at end of file From linuxwolf at jabber.org Tue Sep 3 20:08:39 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: jso/www download.php Message-ID: <20020904010839.35E2963D1A@hades.jabber.org> linuxwolf 02/09/03 20:08:39 Modified: www download.php Log: - Update to (attempt to) fix MSIE rendering Revision Changes Path 1.12 +1 -1 jso/www/download.php Index: download.php =================================================================== RCS file: /home/cvs/jso/www/download.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- download.php 3 Sep 2002 15:35:08 -0000 1.11 +++ download.php 4 Sep 2002 01:08:39 -0000 1.12 @@ -7,7 +7,7 @@ $file_handle = opendir($file_path); $file_idx = 0; ?> - +
From linuxwolf at jabber.org Tue Sep 3 20:09:10 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:52 2004 Subject: [cvslog] cvs commit: jso/doc CHANGELOG Message-ID: <20020904010910.C941063D1A@hades.jabber.org> linuxwolf 02/09/03 20:09:10 Modified: doc CHANGELOG Log: - "forward-port" from 0.2 fix Revision Changes Path 1.5 +5 -2 jso/doc/CHANGELOG Index: CHANGELOG =================================================================== RCS file: /home/cvs/jso/doc/CHANGELOG,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- CHANGELOG 2 Sep 2002 17:15:57 -0000 1.4 +++ CHANGELOG 4 Sep 2002 01:09:10 -0000 1.5 @@ -1,6 +1,10 @@ JSO Release Changes ----------------------------------------------------------- +0.2-PRE3 (2002-09-03) +========== + - (BUG) Fixed generation of jso-api.jar to actually include classes + 0.2-PRE2 (2002-09-02) ========== - Added method to obtain JSOImplementation from Stream @@ -15,8 +19,7 @@ - Enabled more global and accurate namespace support - Changed Packet builders to understand "all attributes" - Added "example" demo/test application - - Changed Extension "semantics to allow "primitive functionality" - - + - Changed Extension "semantics" to allow "primitive functionality" - (BUG) Modified PacketError impl to follow "XMPP CORE" spec 0.1.3-PRE2 (2002-08-07) From linuxwolf at jabber.org Tue Sep 3 20:09:12 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: jso/prj jso-api.build.xml Message-ID: <20020904010912.5057263D1A@hades.jabber.org> linuxwolf 02/09/03 20:09:12 Modified: prj jso-api.build.xml Log: - "forward-port" from 0.2 fix Revision Changes Path 1.8 +1 -1 jso/prj/jso-api.build.xml Index: jso-api.build.xml =================================================================== RCS file: /home/cvs/jso/prj/jso-api.build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jso-api.build.xml 10 Jul 2002 17:05:02 -0000 1.7 +++ jso-api.build.xml 4 Sep 2002 01:09:12 -0000 1.8 @@ -10,7 +10,7 @@ - + From rob at jabber.org Tue Sep 3 20:10:50 2002 From: rob at jabber.org (Rob Norris) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: jabberd/jadc2s clients.c jadc2s.xml Message-ID: <20020904011050.CF80963D52@hades.jabber.org> rob 02/09/03 20:10:50 Modified: jadc2s clients.c jadc2s.xml Log: fixed a nasty race condition in the sasl server init - if the sasl namespace came before the stream to, c->local_id and c->realm weren't configured yet Revision Changes Path 1.57 +30 -24 jabberd/jadc2s/clients.c Index: clients.c =================================================================== RCS file: /home/cvs/jabberd/jadc2s/clients.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- clients.c 31 Jul 2002 01:31:32 -0000 1.56 +++ clients.c 4 Sep 2002 01:10:50 -0000 1.57 @@ -54,7 +54,7 @@ char buf1[24]; #ifdef USE_SASL char buf2[24], *mechs; - int ret, count = 0; + int want_sasl = 0, ret, count = 0; sasl_security_properties_t sec_props; #endif @@ -165,32 +165,11 @@ return; } - /* create a sasl context for this conn */ - snprintf(buf1, 24, "%s;%d", c->local_ip, c->local_port); - snprintf(buf2, 24, "%s;%d", c->ip, c->port); - if((ret = sasl_server_new(c->c2s->sasl_appname, c->local_id, c->realm, buf1, buf2, NULL, 0, &c->sasl)) != SASL_OK) - { - /* !!! find out if sasl_server_new() still allocates conn on failure */ - log_debug(ZONE, "sasl_server_new failed (%s), not offering sasl for this connection", ret, sasl_errstring(ret, NULL, NULL)); - c->sasl = NULL; - } - - memset(&sec_props, 0, sizeof(sasl_security_properties_t)); - sec_props.max_ssf = 0; /* !!! don't allow real SASL security layers, might want to change this */ - sec_props.security_flags = c->c2s->sasl_options; + /* flag it for later */ + want_sasl = 1; - if((ret = sasl_setprop(c->sasl, SASL_SEC_PROPS, &sec_props)) != SASL_OK) - { - log_debug(ZONE, "sasl_setprop failed (%s), not offering sasl for this connection", ret, sasl_errstring(ret, NULL, NULL)); - sasl_dispose(&c->sasl); - c->sasl = NULL; - } - - if(c->sasl != NULL) - log_debug(ZONE, "sasl context initialized"); } #endif - i+=2; } @@ -218,6 +197,33 @@ strcpy(header_end, ">"); #ifdef USE_SASL + if(want_sasl) + { + /* create a sasl context for this conn */ + snprintf(buf1, 24, "%s;%d", c->local_ip, c->local_port); + snprintf(buf2, 24, "%s;%d", c->ip, c->port); + if((ret = sasl_server_new(c->c2s->sasl_appname, c->local_id, c->realm, buf1, buf2, NULL, 0, &c->sasl)) != SASL_OK) + { + /* !!! find out if sasl_server_new() still allocates conn on failure */ + log_debug(ZONE, "sasl_server_new failed (%s), not offering sasl for this connection", ret, sasl_errstring(ret, NULL, NULL)); + c->sasl = NULL; + } + + memset(&sec_props, 0, sizeof(sasl_security_properties_t)); + sec_props.max_ssf = 0; /* !!! don't allow real SASL security layers, might want to change this */ + sec_props.security_flags = c->c2s->sasl_options; + + if((ret = sasl_setprop(c->sasl, SASL_SEC_PROPS, &sec_props)) != SASL_OK) + { + log_debug(ZONE, "sasl_setprop failed (%s), not offering sasl for this connection", ret, sasl_errstring(ret, NULL, NULL)); + sasl_dispose(&c->sasl); + c->sasl = NULL; + } + + if(c->sasl != NULL) + log_debug(ZONE, "sasl context initialized"); + } + if(c->sasl != NULL) /* get the mechanisms */ /* !!! check for errors */ 1.18 +4 -3 jabberd/jadc2s/jadc2s.xml Index: jadc2s.xml =================================================================== RCS file: /home/cvs/jabberd/jadc2s/jadc2s.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- jadc2s.xml 27 Jul 2002 03:26:06 -0000 1.17 +++ jadc2s.xml 4 Sep 2002 01:10:50 -0000 1.18 @@ -24,9 +24,10 @@ - - - + + + + localhost From dlb at jabber.org Tue Sep 3 20:19:07 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML RosterManager.as Message-ID: <20020904011907.BC15763D1A@hades.jabber.org> dlb 02/09/03 20:19:07 Added: . RosterManager.as Log: subscribe / unsubscribe & roster management methods Revision Changes Path 1.1 FML/RosterManager.as Index: RosterManager.as =================================================================== function retrieveRoster(){ trace("RETRIEVE ROSTER"); var ros_query=""; Send(ros_query); } function presenceSubReq(obj,arr){ var from=arr['from']; var name=arr['name'][0]; var mess="roster: "+from+" wishes to subscribe to your presence :"+""+"(accept)"+""+" || "+""+"(decline)"+""; var rost=mess+br; this.MO.presentMessage(rost); } function acceptPresenceSub(){ var argarr=new Array(); argarr=arguments[0].split(","); trace("APS = "+arguments); var username = this.JCO.username; var resource = this.JCO.resource; var from = argarr[0] var subscr=argarr[1]; var mess=""; var pres= ""; trace("accepting PS :"+mess); Send(mess); Send(pres); } function declinePresenceSub(){ var argarr=new Array(); argarr=arguments[0].split(","); trace("APS = "+arguments); var username = this.JCO.username; var resource = this.JCO.resource; var from = argarr[0] //var subscr=argarr[1]; var mess=""; //var pres= ""; Send(mess); //Send(pres); } function presenceUnSubReq(obj,arr){ var from=arr['from']; var name=arr['name'][0]; var mess="roster: "+from+" is unsubscribing from your presence"; var rost=mess+br; this.MO.presentMessage(rost); } function confirmPresenceSub(obj,arr){ var from=arr['from']; var name=arr['name'][0]; var user=""+""+name+""+""; var pres="Subscription to "+from+" Confirmed"; var rost=user+" : "+pres+br; this.MO.presentMessage(rost); //mapMessageInfo(from,user,type, rost,subject) this.JCO.Target.ContactList.table=rost+this.JCO.Target.ContactList.table+br; this.PO.probeJIDPresence(from); } function confirmPresenceUnSub(obj,arr){ var from=arr['from']; var name=arr['name'][0]; var user=""+""+name+""+""; var pres="roster : UNSubscribe from "+from+" Confirmed"; var rost=user+" : "+pres+br; this.MO.presentMessage(rost); this.JCO.Target.ContactList.table=rost+this.JCO.Target.ContactList.table+br; } function addContact(con,group){ var jarray=new Array(); jarray=con.split('@'); var uname=jarray[0]; var server = jarray[1]; var id=generateID(); var addC=""+group+""; trace("ADDING CONTACT :"+addC); var confirms= 'roster: a request to subscribe to '+con+' has been sent to '+server+'.
This address will be added to your contact list when '+con+' approves your request to monitor their presence.
' this.MO.presentMessage('roster: a request to subscribe to '+con+' has been sent to '+server+'.
This address will be added to your contact list when '+con+' approves your request to monitor their presence.
'); Send(addC); monitorContact(con); } function removeContact(){ var con=arguments[0]; var group=arguments[1]; var jarray=new Array(); jarray=con.split('@'); var uname=jarray[0]; var id=generateID(); var group="groupie"; var addC=""+group+""; trace("removing contact :"+addC); Send(addC); ignoreContact(con); } function ignoreContact(con){ var username = this.JCO.username; var resource = this.JCO.resource; var remC=""; Send(remC); } function monitorContact(con){ var remC=""; Send(remC); } function probeJIDPresence(con){ var username = this.JCO.username; var resourcr = this.JCO.resource; var probeC=""; Send(probeC); } //CHANGE presenceHandler___________________________________________ function changeUserPresence(stat,sho){ if(sho != null) { var pres=" "+sho+""+stat+""; //fscommand("presUpdate","titleChange(\""+stat+"\",\""+sho+"\")"); } else { var pres=""+stat+""; //fscommand("presUpdate","titleChange(\""+stat+"\")"); //_root.statband.stat=username+" : "+stat; } this.PO.state = stat; this.PO.show = sho; this.JCO.Target.state = stat; this.JCO.Target.show = sho; this.JCO.Target.child[0].state = this.JCO.username +":"+sho; this.Send(pres); } From dlb at jabber.org Tue Sep 3 20:24:50 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML RichTextHandling.as Message-ID: <20020904012450.5111963D1A@hades.jabber.org> dlb 02/09/03 20:24:50 Added: . RichTextHandling.as Log: Methods to provide rich text editing - see warning ! !! beware , this code provokes some sort of stack pointer error when attempting to impose three or more edits on a message. It will crash the Flash authoring environment - not throw the 'abort process' warning , literally crash the environment. I'm currently reworking the entire design. Regard this file as a placeholder Revision Changes Path 1.1 FML/RichTextHandling.as Index: RichTextHandling.as =================================================================== function editXhtml(xhtml, mod, b, e, target) { //trace('incoming = '+xhtml); trace('incoming : '+xhtml+' B: '+b+' E:'+e); var xo = new XML(); xo.ignoreWhite = true xo.parseXML(xhtml); var omod = '<'+mod+'>'; var cmod = ''; var textobj = {}; textobj.textlength = 0; textobj.prelength; textobj.bspan; textobj.espan; textobj.spantext=""; textobj.b = b; textobj.e = e; textobj.omod = omod; textobj.cmod = cmod; var kids; kids = xo.firstChild.childNodes; for(n=0; n < kids.length; n++){ textobj = parseXhtml(kids[n],textobj); } var htmlstr = ""; reformOutboundXhtml(xo,target,htmlstr); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> function parseXhtml(node,textobj) { var pre; var post; var nkids; var pbool=0; trace("~~~~~~~~~~~~~"); for(n=0; n < node.childNodes.length; n++){ nkids = node.childNodes; textobj.prelength = textobj.textlength; if(nkids[n].nodeType == 1){ textobj.textlength += nkids[n].firstChild.nodeValue.length textobj.spantext = nkids[n].firstChild.nodeValue; }else{ textobj.textlength += nkids[n].nodeValue.length; textobj.spantext = nkids[n].nodeValue; } trace("first tl "+textobj.textlength+": prelength :"+textobj.prelength ); trace("iter. "+n+" "+ textobj.spantext); if(textobj.textlength >= textobj.b){ textobj.bspan = textobj.b - textobj.prelength; pre = textobj.spantext.slice(0,textobj.bspan); post = textobj.spantext.slice(textobj.bspan); trace("B pre = "+pre+" post = "+post); textobj.spantext = pre+ textobj.omod +post; textobj.textlength += 3; textobj.prelength += 3; } if(textobj.textlength >= textobj.e){ trace('found end'); trace("\n bspan = "+ (textobj.bspan+3) +" : e="+textobj.e); trace('prelength = '+textobj.prelength); textobj.espan = ( textobj.bspan + 3 ) + ( textobj.e - textobj.b ) ; pre = textobj.spantext.slice(0,textobj.espan); post = textobj.spantext.slice(textobj.espan); trace("E pre = "+pre+" post = "+post); textobj.spantext = pre+ textobj.cmod +post; } if( nkids[n].hadChildNodes() ){ var kidkid = nkids[n].childNodes; trace("inner ChildNodes = "+nkids[n].nodeName+" : "+kidkid); for(n=0; n < kidkid.length; n++){ parseXhtml(kidkid[n],textobj); } } if(nkids[n].nodeType == 1) nkids[n].firstChild.nodeValue = textobj.spantext; else nkids[n].nodeValue = textobj.spantext; } return textobj; } //___________________________________________________ function reformOutboundXhtml(xhtml,target,htmlstr) { trace('into rOX = '+xhtml); var l = "<"; var g=">"; var cl=" function walkReformedXhtml( kid , htmlstr ) { if(kid.nodeName != null){ var l = "<"; var g=">"; var cl=" dlb 02/09/03 20:25:28 Added: . README.txt Log: what they call a readme file ; ) Revision Changes Path 1.1 FML/README.txt Index: README.txt =================================================================== FML 0.5 Welcome to the Flash Messaging Libraries. The following is a brief introduction to the development of Flash based Jabber clients using the FML. The current state of this code is stable and accommodates most features expected of a 'full' Jabber client ( group chat and 'agents' aren't incorporated in the demo ). excuse the lack of documentation and commentary - this will be incorporated shortly. In the interim demo.fla provides a working example of a Jabber client. This has been designed so that each of the basic features of the client are addressed by a separate movie clip. You can adapted these individually to any other FML based client. * this overview assumes that you are familiar with Flash 5 and actionscripting To build a Jabber Client : 1. place the 'logon' MC at _level0 of your FLA. - be sure that this is named 'logon'. 2. enter your jabber server's domain name and jabber client's UI path as arguments to the MessagingEngine constructor in the first frame. You can name the Messaging Engine instance whatever you like. This instance will be used to call the methods of the Messaging Engine from within the UI. eg . _root.ME = _root.MessagingEngine("jabbit.net", _root.ui); 3. establish the UI elements that pertain to the Jabber client as children of the UI MC you'd registered w/ the Messaging Engine. The core UI MCs : The base instance of the UI - ie. the second arg. in MessagingEngine(). Fields: to , subject _Children of the UI___ AccountLogin ~ receives login information and passes this to the ME Fields: username , password , resource , server ContactList ~ presents roster information Fields: table NewContacts ~ allows users to request presence subscriptions Fields: contact , address , group ContactManager ~ allows the user to remove and modify presence subscriptions Fields: table , confirm PublicPresence ~ allows the user to establish and modify their presence Fields: show , status StandardTextEditor ~ handles standard vs. 'rich' text entry. Fields: outbound ________________________________________ Review demo.fla to determine how the methods associated with these MC's are declared and executed. Be sure to set the FLA's publish settings for Flash 5 , these libraries are not currently compliant with MX. If you are connecting to a JCP server ( jabber.com's ) either declare this within config.xml or set this.server_version = 'JCP' within the MessagingEngine constructor. That should do it. ________________________________________ Again, excuse the lack of futher documentation. These libraries will be undergoing significant revisions towards full componentization and MX compatibility. During this process I'll be adding comments, examples and documents explaining the various implementations available and their method of design. If you have any questions a/o feedback , you can contact me at thehand@mail.com From dlb at jabber.org Tue Sep 3 20:25:43 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML README.htm Message-ID: <20020904012543.C391F63D1A@hades.jabber.org> dlb 02/09/03 20:25:43 Added: . README.htm Log: what they call a readme file in html ; ) Revision Changes Path 1.1 FML/README.htm Index: README.htm =================================================================== FML 0.5 README
  
  FML 0.5
  
  Welcome to the Flash Messaging Libraries.
  The following is a brief introduction to the development of Flash based Jabber clients
  using the FML. The current state of this code is stable and accommodates most features
  expected of a 'full' Jabber client ( group chat and 'agents' aren't incorporated in
  the demo ).
  
  excuse the lack of documentation and commentary - this will be incorporated shortly.
  In the interim demo.fla provides a working example of a Jabber client. This has been
  designed so that each of the basic features of the client are addressed by a 
  separate movie clip. You can adapted these individually to any other FML based client.
  
  
  * this overview assumes that you are familiar with Flash 5 and actionscripting
  
  To build a Jabber Client :
  
  1. place the 'logon' MC at _level0 of your FLA. - be sure that this is named 'logon'.
  2. enter your jabber server's domain name and jabber client's UI path as arguments to 
     the MessagingEngine constructor in the first frame. You can name the Messaging Engine 
     instance whatever you like. This instance will be used to call the methods of the 
     Messaging Engine from within the UI.
     
  	eg .    _root.ME = _root.MessagingEngine("jabbit.net", _root.ui);
  	
  3. establish the UI elements that pertain to the Jabber client as children of the
     UI MC you'd registered w/ the Messaging Engine.
  	 
  	 The core UI MCs :
  	 
  	 The base instance of the UI - ie. the second arg. in MessagingEngine().
  	 	Fields:
  			to , subject
  	 
  	 _Children of the UI___
  	 
  	 AccountLogin ~ receives login information and passes this to the ME
  	 	Fields:
  			username , password , resource , server
  	 
  	 ContactList ~ presents roster information
  	 	Fields:
  			table
  	 
  	 NewContacts ~ allows users to request presence subscriptions
  	 	Fields:
  			contact , address , group
  	 
  	 ContactManager ~ allows the user to remove and modify presence subscriptions 
  	 	Fields:
  			table , confirm
  	 
  	 PublicPresence ~ allows the user to establish and modify their presence
  	 	Fields:
  			show , status
  	 
  	 StandardTextEditor ~ handles standard vs. 'rich' text entry.
  	 	Fields:
  			outbound
  	 
  	 ________________________________________
  	 
  	 Review demo.fla to determine how the methods associated with these MC's 
  	 are declared and executed.
  	 
  	 Be sure to set the FLA's publish settings for Flash 5 , these libraries
  	 are not currently compliant with MX.
  	 
  	 If you are connecting to a JCP server ( jabber.com's ) either declare
  	 this within config.xml or set this.server_version = 'JCP' within the 
  	 MessagingEngine constructor.
  	 
  	 That should do it.
  	 
  	 ________________________________________
  	 
  	 Again, excuse the lack of futher documentation. These libraries will
  	 be undergoing significant revisions towards full componentization and
  	 MX compatibility. During this process I'll be adding comments, examples
  	 and documents explaining the various implementations available and their
  	 method of design.
  	 
  	 If you have any questions a/o feedback , you can contact me at thehand@mail.com
  	 
  	 
  
From dlb at jabber.org Tue Sep 3 20:27:10 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML PresenceHandling.as Message-ID: <20020904012710.89EF163D1A@hades.jabber.org> dlb 02/09/03 20:27:10 Added: . PresenceHandling.as Log: methods that map Jabber protocol elements relevant to presence updates and suscriptions Revision Changes Path 1.1 FML/PresenceHandling.as Index: PresenceHandling.as =================================================================== function presenceHandler( RecObj ){ var PresAttr=new Array(); for(att in RecObj.firstChild.attributes){ var a = RecObj.firstChild.attributes[att]; PresAttr[att] = a; } PresAttr['name'] = PresAttr['from'].split('@'); if(PresAttr['type'] == null){ PresAttr['type'] = "available"; } superclass.parsePresence(PresAttr['type'],RecObj.firstChild,PresAttr,superclass); } function parsePresence(type,obj,attarr,superclass){ var match = new Array( "subscribe", "subscribed", "unsubscribe", "unsubscribed", "unavailable", "available" ); var action = new Array ( superclass.presenceSubReq, superclass.confirmPresenceSub, superclass.presenceUnSubReq, superclass.confirmPresenceUnSub, superclass.jidUnavailable, superclass.jidAvailable ); var val=0; while ( val <= match.length) { var good_match = match[val]; if (type == good_match){ var act=action[val]; act(obj,attarr); break; } else if (( type != good_match) && (val == match.length)){ trace("DEFAULT"); this.jidAvailable(obj,attarr) } ++val; } } function addJIDPresence(obj,user,state,entry){ trace("addJIDPresence "+obj); obj.PresenceArray[user] = entry; this.JCO.Target.ContactList.table = ""; for(p in obj.PresenceArray){ var pres = obj.PresenceArray[p]; trace("presence array["+p+"] = "+pres); this.JCO.Target.ContactList.table = this.JCO.Target.ContactList.table+pres; } entry=user+"*"+escape(entry); var ustat=user+":"+state; this.JCO.Target.presState = state; } function removeJIDPresence(obj,user,state,entry){ delete obj.PresenceArray[user]; } function jidAvailable(obj,arr){ var from=arr['from']; var name=arr['name'][0]; var uid=name+":"+arr['name'][1]; var avarr=new Array(); avarr=obj.childNodes; var user=""+""+name+""+""; for(r=0;r"+pres+"
" var rost=user+" : "+pres+br; addJIDPresence(PresenceObject,from,sho_stat,rost); } function jidUnavailable(obj,arr){ var from=arr['from']; var name=arr['name'][0]; var uid=name; var user=""+""+name+""+""; var pres="unavailable"; var rost=user+" : "+pres+br; addJIDPresence(PresenceObject,from,"unavailable",rost); } From dlb at jabber.org Tue Sep 3 20:27:41 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML OOBHandling.as Message-ID: <20020904012741.1DA9363D1A@hades.jabber.org> dlb 02/09/03 20:27:41 Added: . OOBHandling.as Log: methods for receiving and sending OOB data Revision Changes Path 1.1 FML/OOBHandling.as Index: OOBHandling.as =================================================================== function routeOOBData(oobo , attarr) { var xmlns = oobo.attributes.xmlns; var match = new Array( "jabber:x:autoupdate", "jabber:x:delay", "jabber:x:oob", "jabber:x:roster", "jabber:x:event", "jabber:x:data" ); var action = new Array ( this.presentAutoUpdateNotice, this.presentOfflineMessageInfo, this.presentOOBInfo, this.presentRosterAttachment, this.presentMessageEventNotice, this.presentDataEntryForm ); var val=0; var ret; while ( val <= match.length) { var good_match = match[val] if ( xmlns == good_match){ var act=action[val]; ret = act(oobo,attarr); break; } else if (( xmlns != good_match) && (val == match.length)){ trace("DEFAULT"); ret = this.customExtensionHandler(oobo,attarr); } ++val } trace("returning OOB DATA = "+ret); return ret + br; } function presentAutoUpdateNotice( x , atts ) { var url = ""+download+""; return url; } function presentOfflineMessageInfo( x , atts ) { var stamp = x.attributes.stamp; var from = x.attributes.from; var year = stamp.substr(0,4); var month = stamp.substr(4,2); var day = stamp.substr(6,2); var div = stamp.split("T"); var time = div[1]; var timestamp = ": offline message
received on "+month+"/"+day+"/"+year+" @ "+time; return timestamp; } function presentOOBInfo( x , atts ) { trace("RECEIVING LINK"); var kids = x.childNodes; for( n=0; n < kids.length; n++){ if(kids[n].nodeName == 'url') var url = kids[n].firstChild.nodeValue; if(kids[n].nodeName == 'desc') var desc = kids[n].firstChild.nodeValue; } return br+"a link to "+desc+""; } function presentRosterAttachment( x , atts ) { return "recieved Roster Attachment"; } function presentMessageEventNotice( x , atts ) { return ""; ; } function customExtensionHandler(oobo,attarr) { } function presentDataEntryForm(oobo , attarr) { ; // to be implemented; } From dlb at jabber.org Tue Sep 3 20:42:20 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML MessageHandling.as Message-ID: <20020904014220.75C2C63D1A@hades.jabber.org> dlb 02/09/03 20:42:20 Added: . MessageHandling.as Log: methods for mapping and routing incoming message elements and wrapping outgoing messages Revision Changes Path 1.1 FML/MessageHandling.as Index: MessageHandling.as =================================================================== function findMessageProps(RecObj){ var type = RecObj.firstChild.attributes['type']; if(type==null){ type="normal"; } trace("message type=:"+type); var RecAtt=new Array(); for(att in RecObj.firstChild.attributes){ var a=RecObj.firstChild.attributes[att]; RecAtt[att]=a; } RecAtt['name']=RecAtt['from'].split('@'); RecAtt['name']=RecAtt['name'][0]; superclass.findMessageHandler( type, RecObj.firstChild, RecAtt ); } // findMessageProps CASE____________________________________________ function findMessageHandler(type, obj, attarr){ var match = new Array( "normal", "error", "chat", "groupchat", "headline" ); var action = new Array ( superclass.parseNormalMessage, superclass.routeError, superclass.parseChatMessage, superclass.parseGroupchatMessage, superclass.parseHeadlineMessage ); var val=0; while ( val <= match.length) { var good_match = match[val] if (type == good_match){ var act=action[val]; act(obj, attarr , superclass ); break; } else if (( type != good_match) && (val == match.length)){ superclass.parseNormalMessage(obj,attar); } ++val } } function mapMessageInfo(from,user,type, mess,subject){ this.MO.MessageArray[user]=new Array(); this.MO.MessageArray[user]['from']=from; this.MO.MessageArray[user]['type']=type; this.JCO.Target.from = from; if(this.JCO.Target.to == null) this.JCO.Target.to = from; this.JCO.Target.type = type; this.JCO.Target.mess = mess + this.JCO.Target.mess; if(type != 'chat') this.JCO.Target.subject = subject; else this.JCO.Target.subject=""; } function wrapXhtml(xhtml, to,subject,type) { var xmlo = new XML(); xmlo.parseXML(xhtml); var mess = xmlo.firstChild.firstChild.firstChild.nodeValue; xmlo.firstChild.firstChild.attributes.size = 3 trace('wrapXhtml = '+mess+" : "+xhtml); var subj= subject; if(type != "chat"){ if ( subj != "" || subj != null) subj=""+subj+""; } var typ; if(type != "" && type != null){ typ="type=\""+type+"\""; } var xhtml=""+ xmlo.firstChild.firstChild.toString() +""; var outbound=""+subj+""+mess+""+xhtml+""; this.Send(outbound); ++COM_ID; } function wrapMessage(mess,to,subject,type){ var subj= subject; if( subject != "" && subject != null ){ subj = ""+subject+""; type = 'normal'; } var typ; if( type != "" && type != null){ typ="type=\""+type+"\""; } var outbound=""+subj+""+mess+""; this.Send(outbound); ++COM_ID; } // NORMAL findMessageProps___________________________________________- function parseNormalMessage(obj, atts ){ var RecArr=new Array(); RecArr=obj.childNodes; var from=atts['from']; var user=atts['name']; var type=atts['type']; var m; var oob; for(r=0;r subject : "+subj+""; } if ( RecArr[r].nodeName=='body' ) { var m=RecArr[r].firstChild.nodeValue; if(type==null){ type="none"; } if(subj == null || subj == "" ){ subj="none"; } var pseudo_url=""+user+""; var sender=""+pseudo_url+m_subj+""+br; } } m=sender+oob+m+br+"...stop..."+br; superclass.mapMessageInfo(from,user,"normal", m, subj ); //this.JCO.Target.mess=m + this.JCO.Target.mess+br; delete oob; } function CSSparse(xhtml) { var CSSEl = new XML() var bod = xhtml.firstChild; var kids = bod.childNodes; var style; var cssarr; var NewEl; var newatt; for( n=0; n < kids.length; n++ ){ if(kids[n].attributes.style != ""){ style = kids[n].attributes.style; NewEl = CSSEL.createElement(kids[n].nodeName); cssarr = style.split(";"); for( att in cssarr){ newatt = cssarr[att].split(":"); if( newatt[0] == 'font-family' ) newatt[0] = 'face'; if( newatt[0] == 'font-size' || newatt[0] == ' font-size' ){ trace("font-size !!!"); newatt[0] = 'size'; } kids[n].attributes[ newatt[0] ]=newatt[1]; } } if(kids[n].nodeName == 'em') kids[n].nodeName == 'i'; if(kids[n].nodeName == 'strong') kids[n].nodeName == 'b'; } trace(bod.toString()); return bod.toString(); } //CHAT MESS_____________________________________________ function parseChatMessage(obj, atts){ var RecArr=new Array(); RecArr=obj.childNodes; var from=atts['from']; var user=atts['name']; var type=atts['type']; var xhtml_bool=0; var oob=""; var subj=""; for(r=0;r"+user+""; var sender=""+pseudo_url+""; } } if(xhtml_bool > 0){ superclass.MO.xhtml = 1; with( superclass.JCO.Target.RichTextEditor){ gotoAndStop(2); } } else { superclass.MO.xhtml = 0; with(superclass.JCO.Target.RichTextEditor){ gotoAndStop(1); } } var m; if( superclass.MO.xhtml > 0 ){ m = sender+": "+ oob + richtext + br; } else { m=sender+": "+oob+ m + br; } superclass.mapMessageInfo(from,user,"chat", m ,"",superclass ); delete oob; } //GROUP MESS___________________________________________ function parseGroupchatMessage(obj,atts, superclass){ trace("GROUP_MESS:"+obj.toString()); var RecArr=new Array(); RecArr=obj.childNodes; var from=atts['from']; superclass.matchUser(AgentsObject,from); var user=_root.conf.uid; var type=atts['type']; for(r=0;r"+user+""; if(user==username){ var sender=""+pseudo_url+" : "; } else { var sender=""+pseudo_url+" : "; } } } if(superclass.JCO.Target.Conference.conf_scale==1){ superclass.JCO.Target.Conference.gotoAndPlay(2); } m=sender+oob+m+br; this.JCO.Target.mess=m + this.JCO.Target.mess+br; delete oob; } function parseHeadlineMessage(obj,atts , superclass){ var RecArr=new Array(); RecArr=obj.childNodes; var from=atts['from']; var user=atts['name']; var type=atts['type']; var m; var oob; for(r=0;r subject : "+subj+""; } if ( RecArr[r].nodeName=='body' ) { var m=RecArr[r].firstChild.nodeValue; if(type==null){ type="none"; } if(subj==null){ subj="none"; } var pseudo_url=""+user+""; var sender=""+pseudo_url+m_subj+""+br; } } m=sender+oob+br+m+br+"...stop..."+br; this.JCO.Target.mess=m + this.JCO.Target.mess+br; delete oob; } function mode(obj) { fscommand("relay",obj); } From dlb at jabber.org Tue Sep 3 20:43:41 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML JabberConfig.xml Message-ID: <20020904014341.AEDEB63D1A@hades.jabber.org> dlb 02/09/03 20:43:41 Added: . JabberConfig.xml Log: an xml encoded configuration template for auto-initializing the jabber client Revision Changes Path 1.1 FML/JabberConfig.xml Index: JabberConfig.xml =================================================================== From dlb at jabber.org Tue Sep 3 20:43:01 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML JCL_Globals.as Message-ID: <20020904014301.BA66363D1A@hades.jabber.org> dlb 02/09/03 20:43:01 Added: . JCL_Globals.as Log: constructors and declarations of all global objects Revision Changes Path 1.1 FML/JCL_Globals.as Index: JCL_Globals.as =================================================================== // GLOBAL OBJECTS , VARIABLES & CONSTANTS :: AgentsObject=new Object(); // associated w/ Agents AgentsObject.AgentsObjectArray=new Array(); AgentsObject.prototype.parseIq = parseIq; AgentsObject.prototype.addUserToAgent = addUserToAgent; AgentsObject.prototype.removeUserFromAgent = removeUserFromAgent; AgentsObject.prototype.matchUser = matchUser; AgentsObject.prototype.getAgents = getAgents; AgentsObject.prototype.joinConference = joinConference; AgentsObject.prototype.getAgentStatus = getAgentStatus; AgentsObject.prototype.getConferenceStatus = getConferenceStatus; AgentsObject.prototype.agentProps = agentProps; AgentsObject.prototype.agentServiceQuery = agentServiceQuery; AgentsObject.prototype.agentBrowseResults = agentBrowseResults; AgentsObject.prototype.conferenceResults = conferenceResults; AgentsObject.prototype.rosterResults = rosterResults; ErrorObject = {}; ErrorObject.prototype.queue = []; ErrorObject.prototype.routeError = routeError; ErrorObject.prototype.errBadReq = errBadReq; ErrorObject.prototype.errUnauthorized = errUnauthorized; ErrorObject.prototype.errPaymentReq = errPaymentReq; ErrorObject.prototype.errForbidden = errForbidden; ErrorObject.prototype.errNotFound = errNotFound; ErrorObject.prototype.errNotAllowed = errNotAllowed; ErrorObject.prototype.errNotAcceptable = errNotAcceptable; ErrorObject.prototype.errRegistrationReq = errRegistrationReq; ErrorObject.prototype.errReqTimeout = errReqTimeout; ErrorObject.prototype.errUsernameNotAvail = errUsernameNotAvail; ErrorObject.prototype.errInternalServerError = errInternalServerError; ErrorObject.prototype.errNotImplemented = errNotImpemented; ErrorObject.prototype.errRemoteServerError = errRemoteServerError; ErrorObject.prototype.errServiceUnavailable = errServiceUnavailable; ErrorObject.prototype.errRemoteServerTimeout = errRemoteServerTimeout; ErrorObject.prototype.errStreamError = errStreamError; OOBDataObject = {}; OOBDataObject.prototype.routeOOBData = routeOOBData; OOBDataObject.prototype.routeIqOOB = routeIqOOB; OOBDataObject.prototype.presentAutoUpdateNotice = presentAutoUpdateNotice; OOBDataObject.prototype.presentOfflineMessageInfo = presentOfflineMessageInfo; OOBDataObject.prototype.mapOOBInfo = mapOOBInfo; OOBDataObject.prototype.presentRosterAttachment = presentRosterAttachment; OOBDataObject.prototype.customExtensionHandler = customExtensionHandler; ServerMessageObject = new Object(); UserMessageObject = new Object(); MessageObject=new Object(); // associated w/ messages MessageObject.MessageArray=new Array(); MessageObject.prototype.ServerMessages = ServerMessageObject; MessageObject.prototype.UserMessages = UserMessageObject; MessageObject.prototype.parseNormalMessage = parseNormalMessages; MessageObject.prototype.parseChatMessage = parseChatMessages; MessageObject.prototype.parseHeadlineMessage = parseHeadlineMessage; MessageObject.prototype.parseGroupchatMessage = parseGroupchatMessages; MessageObject.prototype.mapMessageInfo = mapMessageInfo; MessageObject.prototype.wrapMessage = wrapMessage; MessageObject.prototype.wrapXhtml = wrapXhtml; MessageObject.parent; MessageObject.xhtml = 0; MessageObject.presentMessage = function(mess) { this.parent.JCO.Target.mess = mess+"
"+this.parent.JCO.Target.mess; } PresenceObject=new Object(); // associated w/ presence and roster PresenceObject.presence = "available"; PresenceObject.status; PresenceObject.show; PresenceObject.PresenceArray=new Array(); PresenceObject.context='_root'; PresenceObject.prototype.parsePresence = parsePresence ; PresenceObject.prototype.addJIDPresence = addJIDPresence; PresenceObject.prototype.removeJIDPresence = removeJIDPresence; PresenceObject.prototype.jidAvailability = jidAvailability; PresenceObject.prototype.jidUnavailable = jidUnavailable; PresenceObject.prototype.presenceSubReq = presenceSubReq; PresenceObject.prototype.acceptPresenceSub = acceptPresenceSub; PresenceObject.prototype.declinePresenceSub = declinePresenceSub; PresenceObject.prototype.presenceUnSubReq = presenceUnSubReq; PresenceObject.prototype.confirmPresenceSub = confirmPresenceSub; PresenceObject.prototype.confirmPresenceUnSub = confirmPresenceUnSub; PresenceObject.prototype.retrieveRoster = retrieveRoster; PresenceObject.prototype.probeJIDPresence = probeJIDPresence; PresenceObject.prototype.changeUserPresence = changeUserPresence; PresenceObject.prototype.addConference = addConference; PresenceObject.prototype.removeConference = removeConference; PresenceObject.prototype.ignoreConference = ignoreConference; PresenceObject.prototype.monitorConference = monitorConference; ScriptingInterface.InternalMethods = [];// holds the path to the accessible methods ScriptingInterface.InternalMethods['testmethod'] = _root.testmethod; ScriptingInterface.InternalMethods['anothermethod'] = _root.anothermethod; ScriptingInterface.TargetMethod;// set this variable to the name of the internal method ScriptingInterface.TargetMethodArgs;// set this variable to arguments for this method. // the following are used to call external methods ScriptingInterface.MethodCallArray = []; ScriptingInterface.MethodCallArray.Arguments = []; ScriptingInterface.method; ScriptingInterface.args; ScriptingInterface.status = 1; // 0 = SI off , 1 = SI on. function testmethod(arg) { _root.confirmation = arg; } function anothermethod(arg) { _root.confirmation = arg; } /* The UIConfigTemplate can be used to configure dedicated clients that communicate w/ known JID a/o maintain constant properties. */ UIConfigTemplate = new Object() { this.to; this.from; this.user_messages; this.server_messages; this.type; this.show; this.status; this.domain; this.username; this.password; this.resource; return this; } /* The JCO wraps the instance of the Flash Movie Clip object representing the Jabber Messaging User Interface. */ function JabberClientObject(object) { this.Target = object; this.Target.child = []; this.Target.child[0] = _root.statband; this.Target.operation_dialog; // a field reserved for system messages. this.prototype.UIConfig = UIConfigTemplate; this.Template; // receives an XML object containing the config. xml . this.Base // receives a reference to the Base MessagingEngine Object; this.username = object.username; this.password = object.password; this.resource = object.resource; this.server_version mapConfigTemplate = function() { var config = Template.firstChild.childNodes; for(n=0; n < config.length; n++){ var name = config[n].nodeName; var value = config[n].attributes.value; if(name == "username") username = value; if(name == "password") password = value; if(name == "server_version") superclass.server_version = value; if(name == 'resource') resource = value; if(name == "domain"){ this.domain = value; superclass.domain = value; } if(name == 'port'){ superclass.port = value; } if(name == 'binding') superclass.binding = value; } } return this; } function MessagingEngine( domain, client ) { this.prototype.Connect = Connect; this.prototype.Receive = Receive; this.prototype.Receive.superclass = this; this.prototype.initSession = initSession; this.prototype.Login = Login; this.prototype.LogOff = LogOff; this.prototype.Send = Send; this.prototype.SocketMonitor = SocketMonitor; this.prototype.testSock = testSock; this.prototype.routeMessElement = routeMessElement; this.prototype.routeMessElement.superclass = this; this.prototype.findMessageHandler = findMessageHandler; this.prototype.findMessageHandler.superclass = this; this.prototype.callContact = callContact; this.prototype.callContact.superclass = this; this.prototype.errorHandler = errorHandler; this.prototype.errorHandler.superclass = this; this.prototype.iqHandler = iqHandler; this.prototype.iqHandler.superclass = this; this.prototype.presenceHandler = presenceHandler; this.prototype.presenceHandler.superclass = this; this.prototype.streamHandler = streamHandler; this.prototype.streamHandler.superclass = this; this.prototype.findMessageProps = findMessageProps; this.prototype.findMessageProps.superclass = this; this.prototype.submitNewAccountQuery = submitNewAccountQuery; this.prototype.submitNewAccountQuery.superclass = this; this.prototype.createNewAccount = createNewAccount; this.prototype.createNewAccount.superclass = this; this.JCO = JabberClientObject(client); this.JCO.superclass = this; this.SI = ScriptingInterface; this.SI.superclass = this; this.connectionstate; this.server_version ='JCP';//"JCP"; // 'standard' || 'JCP' distinguishes between server versions for xmlns matching this.superclass = this; this.MO = MessageObject; this.MO.parent = this; this.MO.superclass = this; this.PO = PresenceObject; this.PO.superclass = this; this.EO = ErrorObject; this.EO.superclass = this; this.ODO = OOBDataObject; this.ODO.superclass = this; this.domain = domain; this.port= 5222 ; this.binding = 'tcp'; this.server_messages = ServerMessageObject; this.user_messages = UserMessageObject; return this; } From dlb at jabber.org Tue Sep 3 20:44:10 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML InfoQueryHandling.as Message-ID: <20020904014410.CBF5363D1A@hades.jabber.org> dlb 02/09/03 20:44:10 Added: . InfoQueryHandling.as Log: methods for mapping and routing incoming and outgoing IQ elements Revision Changes Path 1.1 FML/InfoQueryHandling.as Index: InfoQueryHandling.as =================================================================== function iqHandler(xmlObj ){ //this=xmlObj; var IqAttr=new Array(); for(att in xmlObj.firstChild.attributes){ var a = xmlObj.firstChild.attributes[att]; IqAttr[att] = a; } if(IqAttr['type']=='result'){ var xmlns=xmlObj.firstChild.firstChild.attributes['xmlns']; superclass.parseIq( xmlns , xmlObj.firstChild, IqAttr, superclass); } if(IqAttr['type']=='error') superclass.routeError( xmlObj , IqAttr , superclass); if(IqAttr['type']=='set'){ var xmlns=xmlObj.firstChild.firstChild.attributes['xmlns']; superclass.parseIq(xmlns,xmlObj.firstChild,IqAttr , superclass); } } function parseIq(xmlns, obj, arr ){ var match = new Array( "jabber:iq:agent", "jabber:iq:browse", "jabber:iq:conference", "jabber:iq:gateway", "jabber:iq:last", "jabber:iq:search", "jabber:iq:time", "jabber:iq:version", "jabber:iq:roster", "jabber:iq:register", "jabber:iq:oob" ); var action = new Array ( superclass.agentProps, superclass.agentBrowseResults, superclass.conferenceResults, superclass.gatewayResults, superclass.lastResult, superclass.searchResult, superclass.timeResult, superclass.versionResult, superclass.rosterResults, superclass.conferenceResults, superclass.routeIqOOB ); var val=0; while ( val <= match.length) { var good_match = match[val] if (xmlns== good_match){ var act=action[val] act(obj , superclass); break; } else if ((xmlns!= good_match) && (val == match.length)){ defaults(); } ++val } } function rosterResults( obj ){ trace("ROSTER RESULTS"); var items=new Array(); items=obj.firstChild.childNodes; for(i=0;i"+""+name+""+""; var m = name + br ; trace(m); superclass.JCO.Target.ContactManager.table = m+ superclass.JCO.Target.ContactManager.table; } } function routeIqOOB( oobo ) { trace("routeIqOOB = "+oobo.toString()); var from = oobo.attributes.from; var user = oobo.attributes.to; var type = 'normal'; var query = oobo.firstChild; var kids = query.childNodes; for( n=0; n < kids.length; n++){ if(kids[n].nodeName == 'url') var url = kids[n].firstChild.nodeValue; if(kids[n].nodeName == 'desc') var desc = kids[n].firstChild.nodeValue; } var mess = ""+desc+"
"; var subject = "file"; trace("IQ OOB = "+mess); superclass.mapMessageInfo(from,user,type, mess, subject) } // ADDUSER______________________________________________ function addUserToAgent(obj,user,jid){ var id=jid.split("/"); obj.AgentsObjectArray[user]=id[1]; _root.conf.to=id[0]; _root.conf.type="groupchat"; var uid=user+br; trace(uid); _root.conf.members.names=uid+_root.conf.members.names+br; } function removeUserFromAgent(obj,user,jid){ for(id in obj.AgentsObjectArray){ if(obj.AgentsObjectArray[id]==user){ delete obj.AgentsObjectArray[id]; _root.conf.mess=id+" has left the room" + _root.conf.mess+br; } } } function matchUser(obj,jid){ var id=jid.split("/"); for( uid in obj.AgentsObjectArray){ if(id[1]== obj.AgentsObjectArray[uid]){ _root.conf.uid=uid; break; } } } function getAgents(){ var id=generateID(); var aglist=""; Send(aglist); } function joinConference(){ var reg; var id="confiqHandler_"+COM_ID; ++COM_ID; var jid=_root.regis.jid; var jarr=jid.split("@"); trace(jarr.length+":"+typeof(jarr)+":"+jarr); for(r=0;r<_root.regis.regisarr['entry'].length;r++){ var rs=_root.regis.regisarr['entry'][r]; rs=eval("_root.regis."+rs); if( rs != null){ var field=_root.regis.regisarr['field'][r]; field=_root.regis.confarr[r].nodeName; var entry=rs; trace(field+" = "+entry); var xmlstring="<"+field+">"+entry+""; trace("xmlElement :"+xmlstring); reg=xmlstring+reg; } } if(jarr.length>1) { var pres=""; Send(pres); var signIN=""+reg+""; Send(signIN); } else { var signIN=""+reg+""; Send(signIN); } } function getAgentStatus(){ var agent=arguments[0]; var id="agentiqHandler_"+COM_ID; COM_ID++; var query=""; Send(query); } function getConferenceStatus(){ var con=arguments[0]; var id="browseiqHandler_"+COM_ID; COM_ID++; var query=""; Send(query); } function agentProps(obj){ trace("AgentProp--:"+obj); } function agentServiceQuery() { var args=arguments[0].split(","); var serv=args[0]; var xmlns=args[1]; var id="SERVCOM_"+COM_ID; ++COM_ID; var query=""; Send(query); } // BROWSE RESULT_______________________________________ function agentBrowseResults(obj){ var arr=new Array(); var jid= obj.firstChild.attributes['jid']; var user=obj.firstChild.attributes['name']; var type=obj.firstChild.attributes['type']; var features; var ns; if(obj.firstChild.nodeName=='user') { var pres=obj.firstChild.attributes['type']; if(pres=="remove") { var u=jid.split("/"); superclass.removeUserFromAgent(AgentsObject,u[1],jid); } else { superclass.addUserToAgent(AgentsObject,user,jid); } } if(obj.firstChild.nodeName=="service") { if(obj.firstChild.hasChildNodes) { var servarr=new Array(); servarr=obj.firstChild.childNodes; for(s=0;s"+ns[2]+"" superclass.JCO.Target.agents.table=serv+br+".........................."+br+superclass.JCO.Target.agents.table+br+"__________"+br; } } } } arr=obj.firstChild.childNodes; for(a=0;a"+name+""; var entry=name+": "+br+"__________"+br; superclass.JCO.Target.agents.table=entry+ superclass.JCO.Target.agents.table+br; } else { trace("conference@"+jid); name=""+name+""; var entry=name+": "+br; superclass.JCO.Target.agents.table=entry+ superclass.JCO.Target.agents.table+br; } } if(arr[a].nodeName=='service' ){ trace("SERVICE :"+arr[a]); name=""+name+""; var entry=name+": "+br+"__________"+br; superclass.JCO.Target.agents.table=entry+ superclass.JCO.Target.agents.table+br; } if(arr[a].nodeName=="user"){ var user=arr[a].attributes['name']; var jid=arr[a].attributes['jid']; superclass.addUserToAgent( superclass.AgentsObject , user, jid); } } } //conference //CONFERENCE_______________________________________ function conferenceResults(obj){ trace("CONFERENCE RESULT:"); trace(obj); var confarr=new Array(); confarr=obj.firstChild.childNodes; trace(confarr); var jid=obj.attributes['from']; superclass.JCO.Target.regis.jid=jid; superclass.JCO.Target.regis.agent="

"+jid+"

" var rec_id=obj.attributes['id'].split("_"); var id="confiqHandler_"+COM_ID; ++COM_ID; superclass.JCO.Target.regis.gotoAndPlay(2); if(obj.firstChild.hasChildNodes){ for(c=0;c"+confarr[c].firstChild.nodeValue+"

"; } if(confarr[c].nodeName=="instructions") { superclass.JCO.Target.regis.instructions=confarr[c].firstChild.nodeValue; } else if(confarr[c].firstChild.nodeValue==null) { var field= superclass.JCO.Target.regis.regisarr['field'][c]; eval('superclass.JCO.Target.regis.'+field)="

"+confarr[c].nodeName+" :

"; } else { var field= superclass.JCO.Target.regis.regisarr['field'][c]; var entry= superclass.JCO.Target.regis.regisarr['entry'][c]; eval('superclass.JCO.Target.regis.'+field)="

"+confarr[c].nodeName+" :

"; eval('superclass.JCO.Target.regis.'+entry)=confarr[c].firstChild.nodeValue; } } superclass.JCO.Target.regis.confarr=confarr; superclass.JCO.Target.regis.jid=jid; } trace("END CONFRES:"); } function gatewayResults(obj){ } function lastResult(obj){ } function searchResult(obj){ } function timeResult(obj){ } function versionResult(obj){ } From dlb at jabber.org Tue Sep 3 20:44:51 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML ErrorHandling.as Message-ID: <20020904014451.D109363D1A@hades.jabber.org> dlb 02/09/03 20:44:51 Added: . ErrorHandling.as Log: methods for mapping , routing , and responding to error messages Revision Changes Path 1.1 FML/ErrorHandling.as Index: ErrorHandling.as =================================================================== function routeError( erro , atts ) { trace("ROUTE ERROR = "+erro.toString()); var origxml = erro; var match = new Array( "400", "401", "402", "403", "404", "405", "406", "407", "408", "409", "500", "501", "502", "503", "504", "stream:error" ); var action = new Array ( superclass.errBadReq, this.errUnauthorized, this.errPaymentReq, this.errForbidden, this.errNotFound, this.errNotAllowed, this.errNotAcceptable, this.errRegistrationReq, this.errReqTimeout, this.errUsernameNotAvail, this.errInternalServerError, this.errNotImplemented, this.errRemoteServerError, this.errServiceUnavailable, this.errRemoteServerTimeout, this.errStreamError ); // ROUTE ERROR = alphabetcrmNot Acceptable var val=0; var nn = erro.firstChild.nodeName; if(nn == null) nn = erro.nodeName; var ecode; if( nn == "stream:error" ){ ecode = 'stream:error'; }else if( nn == 'error'){ ecode = erro.attributes.code; }else{ var kids; if( erro.firstChild.hasChildNodes() && erro.firstChild.firstChild.nodeType != 3 ){ kids = erro.firstChild.childNodes; for(n=0; n < kids.length; n++){ if(kids[n].nodeName == 'error'){ ecode = kids[n].attributes.code; erro = kids[n]; } } } else { kids = erro.childNodes; for(n=0; n < kids.length; n++){ trace(kids[n].nodeName); if(kids[n].nodeName == 'error'){ ecode = kids[n].attributes.code; erro = kids[n]; } } } trace(kids[n].nodeName); } while ( val <= match.length) { var good_match = match[val] if ( ecode == good_match){ trace(ecode+" : "+good_match); var act=action[val] act( origxml , nn , erro , superclass ); break; } else if (( ecode != good_match ) && (val == match.length)){ defaults(); } ++val; } } function errorHandler( RecObj ){ superclass.routeError(RecObj , 'none', superclass ); } function errBadReq( ecode, nn , erro ) { var mess = erro.firstChild.nodeValue; superclass.MO.presentMessage("!! "+mess+" !!
make sure all fields are
correct and complete

"); } function errUnauthorized( origxml , nn , erro ) { var xmlns; var mess; trace("NN:"+origXML.firstChild.nodeName); if( origXML.firstChild.nodeName == 'iq'){ trace(origXML.firstChild.nodeName); xmlns = origXML.firstChild.firstChild.attributes.xmlns; } if( xmlns == 'jabber:iq:auth' ){ mess = erro.firstChild.nodeValue; superclass.MO.presentMessage("!! "+mess+" !!
you cannot login under this account due to one of the following errors.
1. this account does not exists
2. a new account cannot be established using the information provided because the account's username is already in use
3. you've provided an incorrect password
"); } else { mess = erro.firstChild.nodeValue; superclass.MO.presentMessage("!! "+mess+" !!
you do not have authority to perform this action
"); } } function errPaymentReq( ecode, nn , erro ) { } function errForbidden( ecode, nn , erro ) { } function errNotFound( ecode, nn , erro ) { } function errNotAllowed( ecode, nn , erro ) { } function errNotAcceptable( ecode, nn , erro ) { var mess = erro.firstChild.nodeValue; superclass.MO.presentMessage("!! "+mess+" !!
make sure that all fields are
complete and correct
"); } function errRegistrationReq( ecode, nn , erro ) { } function errReqTimeout( ecode, nn , erro ) { } function errUsernameNotAvail( ecode, nn , erro ) { trace("username not available"); } function errInternalServerError( ecode, nn , erro ) { } function errNotImplemented( ecode, nn , erro ) { } function errRemoteServerError( ecode, nn , erro ) { } function errServiceUnavailable( ecode, nn , erro ) { } function errRemoteServerTimeout( ecode, nn , erro ) { } function errStreamError( err , el , erro ) { var mess = erro.firstChild.firstChild.nodeValue; trace("in errStreamError = "+mess); superclass.MO.presentMessage("!! "+mess+" !!"); superclass.LogOff(); } From dlb at jabber.org Tue Sep 3 20:45:24 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML demo.swf Message-ID: <20020904014524.86C5F63D1A@hades.jabber.org> dlb 02/09/03 20:45:24 Added: . demo.swf Log: a compiled version of the demo client - for Flash 5 Revision Changes Path 1.1 FML/demo.swf Index: demo.swf =================================================================== FWS˜ ATA = bspan = – G– ecode – – – Ž Œj0 ë鯯À(æ ùtð€ Ž ÎÆCòT  - I c ¾ ª Ó f ã = ^ z ã $\•½ÜZµP«8P©Äñ8Wo™³ÂÓY¾}á¨æChwê(€ãFvû>™Åí )–¥p *;§ÆìPir/š·Ôñ  0 P p œ « º F@F {qúÒ-‹î?U½°Ú ÂÄR–D̬€½0¶ðLÀ][Òê½8³@jE7Q¸+Uc ¥ –€ Íæ.7 Ö&Œ˜¿%de°ãy‹Í€& ‡@ Dòý˜Þ+D¹°¹Âãì7ì¨lHî´v(7eüà ™ Ù@QçŠ^Xpj’œ$ï\o` ÑÕÄ”<,eÀÂÌW20ñ)dÄ¥€“ Ñ·˜]ž`.¤ùºT4Î&Ó9»šð~Œ\ÿºë÷Ù¡È]jGkvfðûé¯B£%¤r¸Í´Á›k}å·ÞÖijaÕFn­ ù€#’î&K¹l “_e§bkf_a˜ €&¬ 2+ˆl±f:ÆPÞ™?}lf ÑðTÊgòRø¨@"ã*5ðߺãì×/Ì×à…³m–€)Ì ÑÅS™0¼­>b¤ðÙ€uæÔR¶.–iøC·ÖÛ”NZ1¸ºÞ®L€X8 M–'`±;ŠìNòÑÆV× ¹W HbUgKª˜\¬ ÎrÈmœoß즿± ö+—b«g¥°‚Y)²Ä­@7Ûþ3`xÞñlÂd<Ç%éCS%  €L¸ ¾a…”Ñ(匙ÉK!LBTÄZ€•¨Ü%K¼½ùIänQÀJáŽöÀ5j¾Œyïѹ|ç¼hÆÃW1Ô£ùŽšã°Ê ±;Ãbq¾eM†î&Z›Äάö@5jÔvV9-ÞÍ'3“s8$šŽDS²³Ï£~` w€5D­WàP&ÿ¶Ü×›obÔk@ BÉ´Ë~Q Ì—^ô3ˆêǨ@Z¬ø&Y@3žR ˜”Ñ„ƒ6§Jä­RºÒcVBì³KD¤áÛfgº€6[Yö[PÖpÜ—° ~ô ºlKlÏì5l°€5déyQäÀ YÆSgV ýr¯ÔÔÌ  ³Ž €<À§2ìqu<·ÒÓ)-2“€m²÷–çk›7][\´ax(=¼ÉÀ™se€LL7½6îuȵÀW#¶È»…=•A#¡¶ ƒ€5hŠéyWæÅ ç-DÕIKT”àN€bÚOÄÙ€/3 äÊVB+r¡¶³d«v1µ@+j8ö‘¨ØXK¿A*É2pØ›nú6ßüÍ\¬o6©¸ À Df³¤€J¤À #Œéó–€6öQu#€5dR{y^vÅO,2ØW Iô;_=ûb÷Yhº‰´ýV:3i }HšËEÔ_8vþ]ÛL»lòµÜ.Uâ•ÙiÌĶ/Ïâ ÂÄR–D̬€½0¶ðLÀ][Òê½8³@jE7Q¸+Uc ¥ –€ Íæ.7 Ö&Œ˜¿%de°ãy‹Í€& ®­étÞœ ̦,TY1Qh„ ìW.ÅVÏKa²Se‰Z€o·üfÀñ½âÙ„ÈyŽKÒ†¦JA 4üI“ñ@7¤ó!™ lºäLÚÛ—} ³ u™À¾ì¬pP|(§û²±Éy÷×¾s_ùfpMq¥§_6pÌÀ…–3ئh v×W&»$Ã[ ÑV«àM¦þ²ÜÚ›sfäk° B™µ ~@5,‘@rØKÊ [€ ¬’€rÐF MŠ›½…Û,Àˆß³ ì°ä^ÛN@TjQÚõ#“u@f@!Hó$4µH‘BZ±zÜÒÝú[£Y[ò€ÈÜ_¦˜äËK8×_–º½µÆá¦t4̸ Ì:Ì æ/* “Z—Š—ì¯o§"7¬‘;+ÜoŒ»V° Ìà iÿ9û³ h fËjæ6Ô= sùå%˜i@]Ͷ\»i€–˜ ¤%ª?@üŠÙ¦ÚŸ×µ_Þe òyW§   ’í7zêÛ¾mٞ≛ú«8ݦþÌð ùøËŸ [7zåV |ûRt¶d6Xþ°;2û Û-;@ û~ÝŸ±7̇ÑÄ û~ÝŸ±7̇ÑÄ Êånã¾­Ü/ú’ TåWIrcªZ 1—!Ð ¥ w’¬·]Œa­€I0¯/2ß“l_Ì jG³*KLÀkb*EÉU-jÈ‘H#@L£´‚»°€ Ôåå]ÜôýfåS[|´cq5Ì¡&[A°¸ ÎrÈmœoß즿± w×S»8$¿[@’`3^^e¿&ؾ˜Ô“fTvš b¦"Ô­@&á*]åïÊO ›rˆ¶W w°Æ b¦"Ô­@&á*]åïÊO ›rˆ¶W w°Æ =DzîyaD¶SM#6`•à×@²ÌÝrä¶+î7v0_ ‡°ÇÂáJè”rˆFL䥦!*b-@JÔn¥Þ^ü¤ò ·(‹`%pÇ{ `¬¡K­‰Í™í†M– ›X}¥MØÆ™°©¥œù@\çšLå’étqÁëmŸÖÄð ÷±E«]óë’’á#mÈDÖ€™Óeç v’¬»]Œa­€I0­/2ÿ“l_Ì hGµ*K,Àkb*EÊU-jÈ‘H#@L£´‚»°€ Å­ÍÚÏﵜ*Ub•r e"nïb‹V.»æ5Ö1%%ÂFÛ‰­ ÆZã3˜—9€ å –ª²/f‡j~Ö}¬á@¨ð¼e®39‰s˜ ¸ñË‹@ צÛ{ë5è™,ÚdÞˆÜ î¾‘$Þ|-’ûeÔ ßöÛšómìZ€Mh¨Y6™oÒ* !9’ëÞ€&q ßöÛšómìZ€Mh¨Y6™oÒ* !9’ëÞ€&q ˆNdº÷  œ@P¦=B “Y²k` bɵŠÀ& v’«»]œ_­ I0­/2ÿ“l_L hIµ*;- Õ±EÃamû¸—åî›dκv×´¶@V'¶ÀÃ…¡Ø¢åº[ Ú¯€5eººö-·Ýè»[Ë+°T›÷ó%€åLW”-0¦®\ÚÙv€Z v’¬»]Œa­€I0­/2ÿ“l_Ì hGµ*K,Àkb*EÊU-jÈ‘H#@L£´‚»°€ “~þd°¼©Šò€%¦ |‰ ÀúÚˆ ävÙp§²¨$t6Ôp _ öÿ°Nˆí2 ¹wá¾8/P Ž*qÓ/ùqË›$€ÌxÜ·Íüv ôܩɼ¤(kÈnÕ¡° Ž Ž ÑÅS™0¼­>b¤ðÙ€uæÔR¶.–iøC·ÖÛ”NZ1¸ºÞ®L€X8 ö+—b«g¥°‚Y)²Ä­@7Ûþ3`xÞñlÂd<Ç%éCS%  €L¸ w€5D­WàP&ÿ¶Ü×›obÔk@ BÉ´Ë~Q Ì—^ô3ˆêǨ@Z¬ø&Y@3žR ˜”Ñ„ƒ6§Jä­RºÒcVBì³KD¤áÛfgº€6[Yö[PÖpÜ—° ~ô ºlKlÏì5l°€5eÚáf[ ýr¯ÔÔÌ  ³Ž €<À§2ìqu<·ÒÓ)-2“€m²÷–çk›7][\´ax(=¼ÉÀ™se€LL7½6îuȵÀW#¶È»…=•A#¡¶ ƒ€5fèåf1–\‹–æY›¥›ºp f€¸R[¤À'”2¤e*Ix½nÆkj.d ò2IR% Ž q—P~‚`C)êÔÊp TÀÀe€ TÀÀe€ ¶(‡¨ ` °\ ` °\ I °\ P Ž ÓÒád>óô<Â|! Ž !¿ ºy0n ºy0) GÀ¸\ GÀ¸\ è®;”Ÿ4 ¸Aát#FHš+„?¢¾ƒÂèÒ;”Û4  ¿Aáti“F‘ 4"ÃR îSlÏ£Gr›fŸ—–hÚ+ŽäpM² )Ñ\w#úm‘HVŠã¹!³l„ŠtWÈà›eP¨ðw!:dó·¾Ã°íx[jët«st ˆƒÀ ±è‡¨ ª˜¦}Фfœ˜‚šéŠ  –‚¦}¦}®Äž’¤fˆ– ¤fЦ}ž’ª˜¤f†}Š P – NO– I °\ R™ ùÿ°ðe R– аލ_Šœ˜¦}’Bž’œ˜¦} 0 X ] ¤‰’X†§Ë æ°°å" ¹n€Ïž\ùÀ]”Ó9å3 Q€2fS&@#”<æeÎfè { { ô¾êûr™»BÜZ – † ¹€*Îñ&<ÅU ¸‡sbžU€MV‰‰6.(\Àgx“bª€Lª ³¼I1U@&U – ¡¶0ý ¡¶0) Ð@®Kbœ/¶†0V‚„ Ž €Š N–  \ ~Ð-û ص¤ÛgN Ü–r—Dœ3[ÕêÛy£AXÀ†b|A\HÚ²îuÙà+•wî\ ô6u2šç£6Ø,‚¼)%šz‚PW¹"&ØòWô þØÀW™f×°WfvÖ4`W;Ó&ÔõWL¾Ó–°W ÅŽÑ·PWþ¿Ïut ú[ÓÚî ß õgJžºòôÔæíJPÜ€àCdLÊk£ª¹6*Ð4Æ4 @©°dnºÓ[ºaNG”y ð¢r€X DãÚ[vCNÍ—ù@8RÔ²@ Ž 3 N– NO–  R–  R–   From dlb at jabber.org Tue Sep 3 20:46:11 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML demo.fla Message-ID: <20020904014611.2B5C463D1A@hades.jabber.org> dlb 02/09/03 20:46:11 Added: . demo.fla Log: the demo client FLA - for Flash 5 Revision Changes Path 1.1 FML/demo.fla Index: demo.fla =================================================================== ÐÏࡱá        var resource="skunk"; */ var server= _root.ME.domain;//"jabbit.net"; pos=0; stop(); Layer 1 if(xstr==""){ trace("xstr = "+xstr); gotoAndPlay(1); } stop(); Layer 3 stop(); Layer 1 Layer 1 stop(); p Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 gotoAndStop(1); } 0*`TÀ¨€QQRà§ÑNx\£üÉÈ4œäFmÚê«€q é« îöFmuk£¯Ç¨­¾ ênÿÒö}v^é ~ /* the scripting interface enables AS methods to be called within the client from an external pages and for the Jabber client to pass through messages to the browser. */ stop(); ~ { PasswordConfirm.gotoAndPlay(2); }  if(username != null && password != null && resource != null && server != null){ var jco = _root.ME.JCO; jco.username = username; jco.password = password; jco.resource = resouÿÿ Layer 1 € € €  € if(_parent.password != password_confirm ) confirmmess = " ! no match , try again !" else{ confirmmess ="please confirm your password"; var jco = _root.ME.JCO; jco.username = _parent.username; jco.password = _parent.password; jco.resource = _parent.resource; _parent.loginmess = "creating account"; _root.logon.gotoAndPlay("newaccount"); gotoAndPlay(1); } } Layer 1 Layer 1 ~ if( MethodCallArray.length > 0){ var meth; var arg; for( n =0; n < MethodCallArray.length; n++){ meth = MethodCallArray[n]; arg = MethodCallArray.Arguments[n]; trace(meth+ " : "+arg); fscommand(meth,arg); } } else { fscommand(method,args); } gotoAndStop('rest'); stop(); Layer 1 jco.server = server; _root.logon.gotoAndPlay("login"); } else { loginmess = "complete all fields"; } } var username = "flashclient"; var password ="flas Layer 3 Layer 2 Layer 1 _root.MessagingEngine instantiates the MessagingEngine object, passing the constructor the target domain and the path of the user interface. This path is targeted for all UI updates. ** frame 2 contains the login procedures */ // arg 1 = domain , arg 2 = UI path. _root.ME = _root.MessagingEngine("verbots.com", _root.ui); /* ** uncomment this section to use the config.xml file for auto-initialization var config_temp = new XML(); _root.ME.JCO.Template = config_temp; _root.ME.JCO.Base = _root.ME; config_temp.onLoad = _root.ME.JCO.mapConfigTemplate; config_temp.load("JabberConfig.xml"); */ // the following is specific to this demo _root.presence = _root.ui.pubpres.show; _root.statband.state=_root.username+" : "+_root.ui.pubpres.show; _root.ui.nick= ME.JCO.username ; //_root.username; _root.PanelArray =new Array("_root.ui.AccountLogin","_root.ui.PublicPresence","_root.ui.Roster","_root.ui.ContactManagerEditMode","_rÿÿ //_root.login(); stop(); Layer 2 _root.ui.pubpres.gotoAndStop(2); stop(); _root.ME.Connect(_root.ME.Receive); // arg = associated instance of the Receive method. /* the following is the session iniation sequence */ _root.ME.inÿÿ 7å startDrag (this, false, -300, 13, 850, 13); } on (release, dragOut) { stopDrag (); } ~ if( typeof(InternalMethods[TargetMethod]) != 'undefined'){ var meth = InternalMethods[TargetMethod]; eval(meth(TargetMethodArgs)); TargetMethod = ''; TargetMethod.args = ''; } gotÿÿ Layer 1 _root.ME.Login(jco.username, jco.password, jco.resource); _root.ME.connectionstate = 1; // 1 = active stop(); stop() newaccount the following is utilized when logging in after the creation of a new account. */ var jco = _root.ME.JCO; trace("new account creation"); _root.ME.Connect(); _root.ME.initSession(); _root.ME.createNewAccount(jco.username , jco.password , jco.resource ); _root.ME.connectionstate = 1; stop(); _root.tool.gotoAndPlay(2); } Layer 1 //var password = "alphabet"; //var resource = "POC"; pos=1; br="
"; stop(); if(pos == 1){ if(this._y<=26){ this._y=this._y+20; } else { this._y=26; gotoAndPlay(4); } } if(pos == 0){ if(this._y>=-200){ this._y=this._y-20; } else { this._y=-200; gotoAndStop(1); } } stop(); Layer 2 gotoAndPlay(2); _root.statband.gotoAndPlay('retract');; //_root.ME.LogOff(); //_root.statbar.gotoAndPlay(2); //_root.presence.gotoAndStop(1); } //_root.ui.newcon.gotoAndStop(2); _root.ui.NewContacts.contact=recip; _root.ui.NewContacts.addreS _root.panels("_root.ui.NewContacts"); } Layer 4 Œ ÿ P P P € P P P P P  P P   P   € P   €     P     P P   P P P P P P P P P P P P P P P P P P  P P P  P Q Q  P  Q  P P  P  Q P Q  €€  Q P  € P P P Q Q Q Q Q Q Q Q    Q Q S P P  P P   P P  P P Q Q  P Q  P P P  P    P  P P Layer 1 Q Q Q P Q   Q      Q Q Q Q S Q Q Q Q P P P P P P P P P P P P P P  P         P      Q Q P Q P P  Q P P P P      Q  Q P P Q Q Q Q Q Q Q P P Q  P P P P P P  P  P P  P Q Q Q Q Q P    P  P P P  P      P P Q  P Q Q Q S  P P P         P P Q   P  Q Q Q   Q Q Q Q Q Q Q Q Q  Q P P  Q Q P P Q P Q Q Q Q Q P P  P P Q  Q Q Q Q Q P Q P Q Q P  Q Q  Q Q Q Q Q S P € € P €#€ € Q € P  P P P  P P  P P  Q Q P Q Q Q Q Q €)€ Q € Q Q Q € if(_root.ME.connectionstate == 0) _root.logon.gotoAndPlay('login'); else _root.ME.LogOff(); } Layer 3 { var targ = Selection.getFocus(); if(targ == '_level0.ui.RichTextEditor.outbound'){ this.end = Selection.getEndIndex(); this.begin = Selection.getBeginIndex(); } }RichTextEditor var end; Layer 5 Layer 3 ûÿ Layer 2 Layer 1 #include "ConnectionManager.as" #include "RosterManager.as" #include "InfoQueryHandling.as" #include "MessageHandling.as" #include "ErrorHandling.as" #include "OOBHandling.as" #include "PresenceHandling.as" #include "RichTextHandling.as" #include "ASX.as" /* the panels function is specific to this demo */ function panels(tile) { for(p=0; p < PanelArray.length; p++) { if(tile != _root.PanelArray[p] && eval(_root.PanelArray[p]+".pos")==0){ with(eval(_root.PanelArray[p])){ gotoAndStop(1); } } if(tile==_root.PanelArray[p]){ with(eval(_root.PanelArray[p])){ gotoAndStop(2); } } } } Layer 4 Layer 1 Layer 1 Layer 2 //rec.onLoad=gotoAndPlay(3); //var fetch=_root.server+"/pub/chat/fetch.xml?to="+_root.to+"&nick="+_root.nick+"&xml_end=parent.recv(jabber.body);"; //var br="
"; stop(); stop(); OOBoptionsO Layer 1 stop(); F= Layer 1 Layer 1 š scroller=0; this.gotoAndPlay(2); } on(release){ gotoAndStop(1); } š Layer 1 9g; conman_but+ roster_but pres_avail return_but TR_removeC TR_ignoreC Go;B Go;B Layer 1  p gotoAndStop(1); } gotoAndStop(1); _root.ui.ContactManagerEditMode.gotoAndStop(2); } //_root.ui.newcon.gotoAndStop(2); _root.ui.NewContacts.contact=recip; _root.ui.NewContacts.address=to; _root.panels("_root.ui.NewContacts"); } Layer 1 Layer 1 stop(); z  _root.ui.ContactManager.table=""; _root.ME.retrieveRoster(); top(); Layer 2 _root.ui.mess=confirm+_root.br+_root.ui.mess; } stop(); Layer 1 stop(); b gotoAndStop(1); } òÿ _root.panels("_root.ui.conman"); } òÿ on(release){ _root.ME.removeContact(address,group); var confirm=address+" has been removed from your contact list "; //mess=""+"!! Do you wish to cancel this suscription ? :"+""+"(confirm)"+_root.ME.username+":"+ ob +_root.br+ m +_root.br; } { gotoAndStop(3); } |ç Layer 1 { gotoAndPlay(2); } { _root.ME.JCO.Target.RichTextEditor.gotoAndStop(2); } { gotoAndPlay(2); } { _root.ME.JCO.Target.RichTextEditor.gotoAndStop(2); } { gotoAndStop(3); } Layer 1 ÿP’ÿDDDÿªÉÿžžžÿ˜˜˜ÿ Kÿ©Éÿ§¤¡ÿ™°Íÿ555ÿÎÚèÿ1h¡ÿAs§ÿl’ºÿjޏÿ¼ÊÝÿÔÞéÿIIIÿÝåïÿmmmÿáéñÿN‘ÿP’ÿ Mÿ111ÿÖàëÿ‰§ÈÿFŒÿµÇÛÿQ’ÿÇÔäÿfŒ¶ÿØáìÿMÿþþþÿO‘ÿºÌßÿ‘­Ìÿö÷øÿ0fŸÿ–°Íÿáçðÿ;;;ÿEu¨ÿ›³ÏÿR“ÿS”ÿÿÕÕÕÿ¼Íàÿÿ µÐÿéééÿÙâìÿÃÓäÿTTTÿr•½ÿ JŽÿ§»Ôÿo“»ÿ†¥ÇÿÛÛÛÿ˜®ÌÿQ’ÿ¶Ñÿw›Àÿ¡ Ÿÿÿþþÿ¬Ëÿ ¶"{í¡š¿èëF´èëÄ /Îÿô~á©qÓˤkO|ɽ&æop•ÒmÆÛ¾ò{÷©]àœïÀÊðUšÕvQ'° :>.‘éxcï8«f©˜é–˜¹âÂáñÌMÜ@qÑí·‚ßcºy¹Ú¾ò¨heí8½RÌV:C†;+@ T¤T‡K,ñ€”b`Å™ùÌd¥ zØ@;X–l ÆÀ’%ЪbúÄ»†%愯Îg5^@>ô_É ÏÅf:rSŲ)gJsNù`æ«Ð•Ï;ˆq`)W±¡" Üy5¦gΦ˜ô¾$sŠ•@!˜î@,d v8Íh…×cÀ‚šœ¡b~• øgÃ^7¢1ss”>Ãs,R3‹|]yncUÌ©ö˜J03e1– o%,©xÆÄãÔ0Ý«6Z𣍩 §‰ùT1O×à•öŒ UÔ g³ þ#>|w¿+}kÙ|¦TL÷Ù·™.Þ¼´m“û*˜¹˜â9ÁË> `¥ÀÌ…‡÷ÄØÜ …5 ¬e ^uJ\E™…ÿ!N3¡};Y¡õ¹Ë"b·öáO;Wsìºùcý›Ûæ&ù"iòZÙüÜ˯ÃTZÌûÙXp|Lâà›h~œe [¶eg¥Õûøâ§£iÊéáK§¦šrâø¬Èý PiIVcùgi‘Õ×sš—ˆ!‡«%”žØÕXí–>;méU=xDÓúæ-Üï¶qQù‘­^h'þúÓÑ$+DAMG¾›ŒPî4t`ѽê`„®‹"ìD-û#…èÑa=™s¦] ?~ 2lödÿËhÛ„ÚÞó¹‚B"gg(); if(xstr==""){ trace("xstr = "+xstr); gotoAndPlay(1); } stop(); Layer 3 stop(); Layer 1 Layer 1 stop(); p gotoAndStop(1); } { PasswordConfirm.gotoAndPlay(2); } if(username != null && password != null && resource != null && server != null){ var jco = _root.ME.JCO; jco.username = username; jco.password = password; jco.resource = resouÿÿ Layer 1 Layer 1 jco.server = server; _root.logon.gotoAndPlay("login"); } else { loginmess = "complete all fields"; } } var username = "flashclient"; var password ="flas Layer 3 Layer 2 Layer 1 _root.MessagingEngine instantiates the MessagingEngine object, passing the constructor the target domain and the path of the user interface. This path is targeted for all UI updates. ** frame 2 contains the login procedures */ // arg 1 = domain , arg 2 = UI path. _root.ME = _root.MessagingEngine("jabbit.net", _root.ui); /* ** uncomment this section to use the config.xml file for auto-initialization var config_temp = new XML(); _root.ME.JCO.Template = config_temp; _root.ME.JCO.Base = _root.ME; config_temp.onLoad = _root.ME.JCO.mapConfigTemplate; config_temp.load("JabberConfig.xml"); */ // the follo Layer 2 trace("receiver 3"); var pm=_root.parseMess(_root.receiver.rec); trace("pm="+pm); _root.ui.chat=""+to_nick+" : "+pm+br+_root.ui.chat+br; gotoAndPlay(1); */ Layer 3 _root.presence = _root.ui.pubpres.show; _root.statband.state=_root.username+" : "+_root.ui.pubpres.show; _root.ui.nick= ME.JCO.username ; //_root.username; _root.PanelArray =new Array("_root.ui.AccountLogin","_root.ui.PublicPresence","_root.ui.Roster","_root.ui.ContactManagerEditMode","_roÿÿ //_root.login(); stop(); Layer 2 _root.ui.pubpres.gotoAndStop(2); stop(); Layer 1 { gotoAndPlay(2); } else { _root.setNick(); } _root.ME.Connect(_root.ME.Receive); // arg = associated instance of the Receive method. /* the following is the session iniation sequence */ _root.ME.iniÿÿ 7å startDrag (this, false, -300, 13, 850, 13); } on (release, dragOut) { stopDrag (); } Layer 3 stop(); stop(); Layer 4 Layer 1 _root.ME.Login(jco.username, jco.password, jco.resource); _root.ME.connectionstate = 1; // 1 = active stop(); stop() newaccount the following is utilized when logging in after the creation of a new account. */ var jco = _root.ME.JCO; trace("new account creation"); _root.ME.Connect(); _root.ME.initSession(); _root.ME.createNewAccount(jco.username , jco.password , jco.resource ); _root.ME.connectionstate = 1; stop(); _root.tool.gotoAndPlay(2); } Layer 1 //var password = "alphabet"; //var resource = "POC"; pos=1; br="
"; stop(); if(pos == 1){ if(this._y<=26){ this._y=this._y+20; } else { this._y=26; gotoAndPlay(4); } } if(pos == 0){ if(this._y>=-200){ this._y=this._y-20; } else { this._y=-200; gotoAndStop(1); } } stop(); Layer 2 gotoAndPlay(2); _root.statband.gotoAndPlay('retract');; //_root.ME.LogOff(); //_root.statbar.gotoAndPlay(2); //_root.presence.gotoAndStop(1); } Layer 1 Layer 2 tools_roster.gotoAndStop(2); } //_root.ui.newcon.gotoAndStop(2); _root.ui.NewContacts.contact=recip; _root.ui.NewContacts.address=to; _root.panels("_root.ui.NewContacts"); } Layer 4 Œ ÿ P P P € P P P P P  P P   P   € P  getURL("http://verbots.com/"); } //_root.ME = _root.MessagingEngine("jabbit.net", _root.userinterface ); var base = _root.ME; var jco = _root.ME.JCO; if(jco.username != null && jco.password != null){ _root.logon.gotoAndPlay('login'); } else { _root.panels("_root.ui.AccountLogin"); } _root.ME.JCO.Target.gotoAndPlay(2); jco.mess ="you are connected to a Jabber unified IM server"+"

"+"the 'Presence' options on the right indicate your state of availability
"; jco.chat = username; _root.statband.gotoAndPlay(2); //_root.ui.gotoAndPlay(2); //_root.ui.mess="you are connected to a Jabber unified IM server"+"

"+"the 'Presence' options on the right indicate your state of availability
"; //_root.ui.chat=username; } _root.statband.gotoAndPlay(2); _root.ui.gotoAndPlay(2); } stop(); //_root.statband.gotoAndPlay(2); //_root.ui.gotoAndPlay(2); //_root.ui.mess="you are connected to a Jabber unified IM server"+"

"+"the 'Presence' options on the right indicate your state of availability
"; //_root.ui.chat=username; _root.statband.state = jco.username+" : "+_root.ME.PO.show; _root.ui.nick = jco.username; jco.gotoAndPlay(2); _root.statband.gotoAndPlay(11); } stop(); fscommand("mode","notify"); fscommand("watcher","killNotifier()"); fscommand("watcher","shrink()"); _root.notify.gotoAndStop(1); */ _root.ME.JCO.Target.gotoAndPlay(2); this.gotoAndPlay(11); _root.ui.gotoAndPlay(2); } Layer 1 Layer 3 Layer 1  €     P     _root.tool.gotoAndPlay(2); } Layer 2 _root.panels("_root.ui.PublicPresence"); } tools_roster.gotoAndStop(2); } //_root.ui.conlist.gotoAndStop(2); //_root.panels("_root.ui.roster"); _root.panels("_root.ui.ContactList"); } //_root.ui.conman.gotoAndStop(2); _root.panels("_root.ui.ContactManager"); } _root.panels("_root.ui.AccountLogin"); } buttons slide=""; br="
"; //stop(); if(pos == 1){ if(this._x<=300){ this._x=this._x+20; } else { this._x=300; gotoAndPlay(4); } } if(pos == 0){ if(this._x>=-300){ this._x=this._x-20; } else { this._x=-300; gotoAndStop(1); } } stop(); Layer 1 this._x=this._x+7; //gotoAndPlay(6); } if(slide==0){ this._x=this._x-7; //gotoAndPlay(6); } /* if(slide=2){ stop(); } */ P P   P P P P P P P P P P P P P P P P P P  P P P  P Q Q  P  Q  P P  P  Q P Q  €€  Q P  € P P P Q Q Q Q Q Q Q Q    Q Q S P P  P P   P P  P P Q Q  P Q  P P P  P    P  P P Q Q Q P Q   Q      Q Q Q Q S Q Q Q Q P P P P P P P P P P P P P P  P         P      Q Q P Q P P  Q P P P P      Q  Q P P Q Q Q Q Q Q Q P P Q  P P P P P P  P  P P  P Q Q Q Q Q P    P  P P P  P      P P Q  P Q Q Q S  P P P         P P Q   P  Q Q Q   Q Q Q Q Q Q Q Q Q  Q P P  Q Q P P Q P Q Q Q Q Q P P  P P Q  Q Q Q Q Q P Q P Q Q P  Q Q  Q Q Q Q Q S P € € P €#€ € Q € P  P P P  P P  P P  Q Q P Q Q Q Q Q €)€ Q € Q Q Q € if(_root.ME.connectionstate == 0) _root.logon.gotoAndPlay('login'); else _root.ME.LogOff(); } Layer 3 { var targ = Selection.getFocus(); if(targ == '_level0.ui.RichTextEditor.outbound'){ this.end = Selection.getEndIndex(); this.begin = Selection.getBeginIndex(); } }RichTextEditor var end; Layer 5 getURL("http://verbots.com/"); } //_root.ME = _root.MessagingEngine("jabbit.net", _root.userinterface ); var base = _root.ME; var jco = _root.ME.JCO; if(jco.username != null && jco.password != null){ _root.logon.gotoAndPlay('login'); } else { _root.panels("_root.ui.AccountLogin"); } _root.ME.JCO.Target.gotoAndPlay(2); jco.mess ="you are connected to a Jabber unified IM server"+"

"+"the 'Presence' options on the right indicate your state of availability
"; jco.chat = username; _root.statband.gotoAndPlay(2); //_root.ui.gotoAndPlay(2); //_root.ui.mess="you are connected to a Jabber unified IM server"+"

"+"the 'Presence' options on the right indicate your state of availability
"; //_root.ui.chat=username; } _root.statband.gotoAndPlay(2); _root.ui.gotoAndPlay(2); } stop(); //_root.statband.gotoAndPlay(2); //_root.ui.gotoAndPlay(2); //_root.ui.mess="you are connected to a Jabber unified IM server"+"

"+"the 'Presence' options on the right indicate your state of availability
"; //_root.ui.chat=username; _root.statband.state = jco.username+" : "+_root.ME.PO.show; _root.ui.nick = jco.username; jco.gotoAndPlay(2); _root.statband.gotoAndPlay(11); } stop(); fscommand("mode","notify"); fscommand("watcher","killNotifier()"); fscommand("watcher","shrink()"); _root.notify.gotoAndStop(1); */ _root.ME.JCO.Target.gotoAndPlay(2); this.gotoAndPlay(11); _root.ui.gotoAndPlay(2); } Layer 1 Layer 3 Layer 1 Layer 1 stop();  show="available"; status=""; confirm="available"; }  show="xa"; status="let's chat later"; confirm="extended away"; } o show="away"; status=""; confirm="away"; }  _root.ME.changeUserPresence(status,show); _root.ui.mess="Presence set to "+show+" : "+status+_root.br+ _root.ui.mess+_root.br; }    show="dnd"; status="let's chat later"; confirm="don't disturb"; }  gotoAndStop(1); } stop();  p gotoAndStop(1); } gotoAndStop(1); _root.ui.ContactManagerEditMode.gotoAndStop(2); } //_root.ui.newcon.gotoAndStop(2); _root.ui.NewContacts.contact=recip; _root.ui.NewContacts.address=to; _root.panels("_root.ui.NewContacts"); } Layer 1 stop(); z  Layer 1 Layer 2 _root.ui.mess=confirm+_root.br+_root.ui.mess; } stop(); Layer 1 _root.ui.ContactManager.table=""; _root.ME.retrieveRoster(); top(); Layer 2 stop(); Layer 2 € p gotoAndStop(1); } € Layer 1 Layer 1 € stop(); Œ Layer 3 //_root.ui.mess=confirm+_root.br+_root.ui.mess; } } stop(); Layer 1 stop(); p gotoAndStop(1); } contact=""; address=""; group=""; } úþ if(group==null){ group="jabbit"; _root.ME.addContact(address,group); //var confirm="a request to subscribe to "+contact+" has been sent to "+address+". This address will be added to your contact list when "+contact+" approves your request to monitor their presence."; //_root.ui.mess=confirm+_root.br+br+_root.ui.mess; } else { _root.ME.addContact(address,group); //var confirm="a request to subscriÿÿ outbound=""; //_root.recv(); } ooboptions € Layer 1 var r=_parent.recip.split("@"); if(r[1] != null){ _parent.to= _parent.recip; } _root.wrapMessage(outbound, _parent.to, _parent.subject, "chat"); _root.ui.mess=""+_root.ME.username+":"+ outbound + _root.br+ _root.ui.mess + _root.br;ÿÿ { gotoAndPlay(2); } Layer 3 ûÿ Layer 2 Layer 1 #include "ConnectionManager.as" #include "RosterManager.as" #include "InfoQueryHandling.as" #include "MessageHandling.as" #include "ErrorHandling.as" #include "OOBHandling.as" #include "PresenceHandling.as" #include "RichTextHandling.as" #include "ASX.as" /* the panels function is specific to this demo */ function panels(tile) { for(p=0; p < PanelArray.length; p++) { if(tile != _root.PanelArray[p] && eval(_root.PanelArray[p]+".pos")==0){ with(eval(_root.PanelArray[p])ÿÿ Layer 2 œª _root.pullRoster(); } œª if(group==null || addC==null){ mess="!! provide both an address and 'group' context for this subscription"; } else { mess=""; _root.addCon(addC,group); } } ±ª if(remove==null){ mess="!! click on the address field of the contact you would like to remove"; } else { mess=""+"!! Do you wish to cancel this suscription ? :"+"
"+"(confirm)"+""+" || "+""+"(deny)"+""; } } œª œª if(callC==null){ mess="!! click on the address field of the contact you would like to monitor"; } else { _root.monitorCon(callC); } } œª if(callC==null){ mess="!! click on the address field of the contact you would like to ignore"; } else { _root.ignoreCon(callC); } } œª œª _root.pullRoster(); } œª if(group==null || addC==null){ mess="!! provide both an address and 'group' context for this subscription"; } else { mess=""; _root.addCon(addC,group); } } ±ª if(remove==null){ mess="!! click on the address field of the contact you would like to remove"; } else { mess=""+"!! Do you wish to cancel this suscription ? :"+""+"(confirm)"+""+" || "+""+"(deny)"+""; } } œª œª if(callC==null){ mess="!! click on the address field of the contact you would like to monitor"; } else { _root.monitorCon(callC); } } œª if(callC==null){ mess="!! click on the address field of the contact you would like to ignore"; } else { _root.ignoreCon(callC); } } œª Layer 1 gotoAndStop(1); } } if(tile==_root.PanelArray[p]){ with(eval(_root.PanelArray[p])){ gotoAndStop(2); } } } } Layer 4 OOBoptionsO F= 9g; conman_but+ roster_but pres_avail return_but TR_removeC TR_ignoreC Go;B Go;B Layer 2 Layer 1 _root.statband.gotoAndPlay(2); _root.ui.gotoAndPlay(2); } stop(); //_root.statband.gotoAndPlay(2); //_root.ui.gotoAndPlay(2); //_root.ui.mess="you are connected to a Jabber unified IM server"+"

"+"the 'Presence' options on the right indicate your state of availability
"; //_root.ui.chat=username; _root.statband.state = jco.username+" : "+_root.ME.PO.show; _root.ui.nick = jco.username; jco.gotoAndPlay(2); _root.statband.gotoAndPlay(11); } stop(); fscommand("mode","notify"); fscommand("watcher","killNotifier()"); fscommand("watcher","shrink()"); _root.notify.gotoAndStop(1); */ _root.ME.JCO.Target.gotoAndPlay(2); this.gotoAndPlay(11); _root.ui.gotoAndPlay(2); } Layer 1 Layer 3 Layer 1 getURL("http://24.249.142.33/jabbit/"); } Layer 1 Layer 1 Layer 1 7å startDrag (this, false, -300, 13, 850, 13); } on (release, dragOut) { stopDrag (); } } */ Layer 3 Layer 1 _root.tool.gotoAndPlay(2); } _root.tool.gotoAndPlay(2); } Layer 2 _root.panels("_root.ui.pubpres"); } //_root.ui.conlist.gotoAndStop(2); //_root.panels("_root.ui.roster"); _root.panels("_root.ui.conlist"); } //_root.ui.conman.gotoAndStop(2); _root.panels("_root.ui.conman"); } _root.panels("_root.ui.AccountLogin"); } buttons slide=""; br="
"; //stop(); if(pos == 1){ if(this._x<=300){ this._x=this._x+20; } else { this._x=300; gotÿÿ //_root.login(); stop(); Layer 2 } } if(pos == 0){ if(this._x>=-300){ this._x=this._x-20; } else { this._x=-300; gotoAndStop(1); } } stop(); this._x=this._x+7; //gotoAndPlay(6); } if(slide==0){ this._x=this._x-7; //gotoAndPlay(6); } /* if(slide=2){ stop(); ÿÿ Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 stop();  show="available"; status=""; confirm="available"; }  show="xa"; status="let's chat later"; confirm="extended away"; } o show="away"; status=""; confirm="away"; }  _root.ME.changeUserPresence(status,show); _root.ui.mess="Presence set to "+show+" : "+status+_root.br+ _root.ui.mess+_root.br; }    show="dnd"; status="let's chat later"; confirm="don't disturb"; }  gotoAndStop(1); } stop();  Layer 1 Layer 1 Layer 1 Layer 1 _root.ui.conman.table=""; _root.ME.retrieveRoster(); top(); Layer 2 p gotoAndStop(1); } gotoAndStop(1); _root.ui.coned.gotoAndStop(2); } p gotoAndStop(1); } gotoAndStop(1); _root.ui.coned.gotoAndStop(2); } //_root.ui.newcon.gotoAndStop(2); _root.ui.newcon.contact=recip; _root.ui.newcon.address=to; _root.panels("_root.ui.newcon"); } Layer 1 z  stop(); z  Layer 1 Layer 1 Layer 2 p gotoAndStop(1); } _root.panels("_root.ui.conman"); } _root.removeCon(address); var confirm=address+" has been removed from your contact list "; //mess=""+"!! Do you wish to cancel this suscription ? :"+""+"(confirm)"+""+" || "+""+"(deny)"+""; _root.ui.mess=confirm+_roo.br+_root.ui.mess; } confirm="Contact List entry has been saved "; _root.ui.mess=confirm+_root.br+_root.ui.mess; } stop(); b gotoAndStop(1); } òÿ _root.panels("_root.ui.conman"); } òÿ on(release){ _root.ME.removeContact(address,group); var confirm=address+" has been removed from your contact list "; //mess=""+"!! Do you wish to cancel this suscription ? :"+""+"(confirm)"+""+" || "+""+"(deny)"+""; _root.ui.mess= confirm+_root.br+_root.ui.mess; } ìþ confirm="Contact List entry has been saved "; _root.ui.mess=confirm+_root.br+_root.ui.mess; } stop(); Layer 1 Layer 1 Layer 2 p gotoAndStop(1); } p gotoAndStop(1); } Layer 1 Œ stop(); Œ stop(); Layer 1 p gotoAndStop(1); } contact=""; address=""; group=""; } if(group==null){ group="general"; _root.addContact(address,group); var confirm="a request to subscribe to "+contact+" has been sent to "+address+". This address will be added to your contact list when "+contact+" approves your request to monitor their presence."; _root.ui.mess=confirm+_root.br+_root.br+_root.ui.mess; } else { _root.addContact(address,group); var confirm="a request to subscribe to "+contact+" has been sent to "+address+". This address will be added to your contact list when "+contact+" approves your request to monitor their presence."; _root.ui.mess=confirm+_root.br+_root.br+_root.ui.mess; } } stop(); p gotoAndStop(1); } contact=""; address=""; group=""; } úþ if(group==null){ group="jabbit"; _root.ME.addContact(address,group); //var confirm="a request to subscribe to "+contact+" has been sent to "+address+". This address will be added to your contact list when "+contact+" approves your request to monitor their presence."; //_root.ui.mess=confirm+_root.br+br+_root.ui.mess; } else { _root.ME.addContact(address,group); //var confirm="a request to subscribe to "+contact+" has been sent to "+address+". This address will be added to your contact list when "+contact+" approves your request to monitor their presence."; //_root.ui.mess=confirm+_root.br+_root.ui.mess; } } stop(); Layer 1 ~ Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 š scroller=0; this.gotoAndPlay(2); } on(release){ gotoAndStop(1); } š Layer 2 Layer 1 stop(); scroller=1; this.gotoAndPlay(2);; } on(release){ this.gotoAndStop(1);; } Layer 3 stop(); if(scroller == 1){ _parent.mess.scroll=_parent.mess.scroll-1 } if(scroller == 0){ _parent.mess.scroll=_parent.mess.scroll+1 } Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 Layer 1 _root.ui.StandardTextEditor.gotoAndStop(1); stop(); { } { } { } _root.ui.StandardTextEditor.gotoAndStop(2); trace("______________RTE ACTIVATED "); stop(); Layer 2 var ob = this.outbound; this.outbound = ""; trace("OB :"+ob); _root.wrapXhtml( ob ,_parent.to ,_parent.subject ,"chat"); _root.ui.mess=""+_root.ME.username+":"+ this.outbound +_root.br+_root.ui.mess+_root.br; } Layer 3 Layer 1 Layer 1 Layer 1 Layer 1 var r=_parent.recip.split("@"); if(r[1] != null){ _parent.to= _parent.recip; } _root.wrapMessage(outbound, _parent.to, _parent.subject, "chat"); _root.ui.mess=""+_root.ME.username+":"+ outbound + _root.br+ _root.ui.mess + _root.br; outbound=""; //_root.recv(); } € var r=_parent.recip.split("@"); if(r[1] != null){ _parent.to= _parent.recip; } _root.wrapMessage(outbound, _parent.to, _parent.subject, "chat"); _root.ui.mess=":"+_root.ME.username+":"+ outbound + _root.br+ _root.ui.mess + _root.br; outbound=""; //_root.recv(); } Layer 1 From dlb at jabber.org Tue Sep 3 20:47:07 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML ConnectionManager.as Message-ID: <20020904014707.CD86663D1A@hades.jabber.org> dlb 02/09/03 20:47:07 Added: . ConnectionManager.as Log: connection and session management methods Revision Changes Path 1.1 FML/ConnectionManager.as Index: ConnectionManager.as =================================================================== function Connect(SuperClassReciever){ Socket= new XMLSocket(); Socket.onConnect = testSock; Socket.onXML = SuperClassReciever; Socket.connect( this.domain , this.port ); this.JCO.Target.operation_dialog = "Connecting ..."; this.MO.presentMessage("Connecting"); } // LOGIN______________________________________________________________ function Login(username, password, resource) { loginID = generateID(); var loginstring = ""+""+""+username+""+""+password+""+""+resource+""+""+""; this.Send(loginstring); var p= this.PO.presence ; var state=""+p+""; //this.JCO.Target.operation_dialog = "Logging in ..."; this.Send(state); } // LOG_OFF__________________________________________________________ function LogOff(socketID,command,nick) { var presence = ""; Send(presence); var kill=""; Socket.send(kill); this.MO.presentMessage("logging off "+this.domain+""); this.Socket.close(); this.MO.presentMessage("session terminated on "+this.domain+""); this.connectionstate = 0; } //__________________________________________________________ function SocketMonitor( id , command ){ // Maintains register of the number and state of active sockets if ( command == "created" ){ ++SOCKET_COUNT; } if ( command == "destroyed" ){ --SOCKET_COUNT; for ( s=0; s< Socket_Array.length ; ++s){ if ( Socket_Array[s]== Socket_Obj ) { Socket_Array[s].pop(); } } } trace("SockMon .. SOCKET_COUNT= "+SOCKET_COUNT ); } //TEST SOCKET__________________________________________________________ function testSock( boolean ){ this.MO.presentMessage("testing connection ..."); if (boolean) this.MO.presentMessage("connected to "+this.domain+""); else this.MO.presentMessage("connection failed"); } //INIT SESSION__________________________________________________________ function initSession(){ var init_hello ; // xml stream root this.MO.presentMessage("Initiating Session with "+this.domain+""); this.JCO.Target.operation_dialog = ""; if( this.server_version != "JCP") init_hello=""; else init_hello=""; trace(init_hello); this.Send( init_hello ); } // SEND __________________________________________________________ function Send(message){ var msg = new XML(message); Socket.send(msg); trace("...................................................................."); trace("SENT ::"+msg); delete msg; } // RECEIVE _________________________________________________________________ function Receive(xmlObj){ var RecObj=new XML(); var RecArr=new Array(); RecObj.parseXML(xmlObj); var node = RecObj.firstChild.nodeName; superclass.routeMessElement( node , RecObj ); if(ScriptingInterface.status > 0){ ScriptingInterface.method = 'catchXML'; ScriptingInterface.args = RecObj.toString();; ScriptingInterface.gotoAndPlay('external'); } trace("REC :"+RecObj.toString()); trace("--------------------------"); } // Receiving Case__________________________________________________________ function routeMessElement(node, obj){ var match = new Array( "stream:error", "presence", "iq", "message", "stream:stream" ); var action = new Array ( superclass.errorHandler, superclass.presenceHandler, superclass.iqHandler, superclass.findMessageProps, superclass.streamHandler ); var val=0; while ( val <= match.length) { var good_match = match[val] if (node == good_match){ var act=action[val] act( obj ) ; break; } else if ((node != good_match) && (val == match.length)){ defaults(); } ++val; } } function defaults() { ; } function streamHandler( RecObj ) { br=RecObj.createElement('br'); superclass.MO.presentMessage("Session Established"); _root.logon.gotoAndStop(2); } function assignActionTo(){ // this is the function called within links via 'asfunction' targ = this.JCO.Target; var assarr=new Array(); assarr = arguments[0].split(","); var addr = assarr[0].split("@"); targ.to = assarr[0]; targ.recip = addr[0] if(assarr[1]=="none") assarr[1]=null; if(assarr[2]=="none"){ assarr[2]=null; } targ.type = assarr[1]; targ.subject = assarr[2]; } function callContact(){ this.JCO.Target.to=arguments[0] } function passField(){ var uid; var id; var targ = this.JCO.Target; uid = arguments[0].split(":"); targ.ContactManager.confirm=uid[0]; targ.to=uid[0]; id=uid[0].split("@"); targ.coned.address=uid[0]; targ.recip=id[0]; targ.coned.username=id[0]; targ.coned.group=uid[1]; } function clearField(){ this.JCO.Target.ContactManager.remove=""; } //_________________________________________________________ function submitNewAccountQuery(username,password,resource) { var new_query = ""+ "" this.Send(new_query); } function createNewAccount(username , password , resource ){ var targ = this.JCO.Target; var sid = generateID(); var reg_query=""+ ""+""+username+""+""+resource+""+""+password+""+""+"" this.Send(reg_query); } function generateID(){ return Math.round(Math.random()*10000); } //________________________________________________________ __ // CALL NOTEPAD_____________________________________________ function callNotepad() { var targ = this.JCO.Target; fscommand("notepad","callNotepad(\""+targ.username+"\",\""+targ.password+"\")"); } From dlb at jabber.org Tue Sep 3 20:47:37 2002 From: dlb at jabber.org (David Beard) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: FML ASX.as Message-ID: <20020904014737.706EE63D1A@hades.jabber.org> dlb 02/09/03 20:47:37 Added: . ASX.as Log: an overwrite of the String.split() method Revision Changes Path 1.1 FML/ASX.as Index: ASX.as =================================================================== String.prototype.split = function (d) { // This override of the String Object's 'split' method was developed by Damien Morton // of Dennis Interactive and provides an estimated 40x factor of improvement over the native // AS string.split(). var a = []; var len = this.length; if ((d == null) || (d.length == 0)) { var i = 0; while (i < len) a[i++] = substring(this, i, 1); }else { var j = 1; var i = 1; var n = 0; while (i < len) if (substring(this, i++, 1) == d) { a[n++] = substring(this, j, i-j-1); j = i; } a[n] = substring(this, j); } return a; } function parseNS(att){ } From rob at jabber.org Tue Sep 3 20:53:13 2002 From: rob at jabber.org (Rob Norris) Date: Fri Jul 9 09:52:53 2004 Subject: [cvslog] cvs commit: jabberd/c2s-streams Makefile c2s.c Message-ID: <20020904015313.C1B1363D38@hades.jabber.org> rob 02/09/03 20:53:13 Modified: c2s-streams Makefile c2s.c Log: full sasl client and server support, lots of code cleanups Revision Changes Path 1.6 +1 -1 jabberd/c2s-streams/Makefile Index: Makefile =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Makefile 17 Aug 2002 07:45:08 -0000 1.5 +++ Makefile 4 Sep 2002 01:53:13 -0000 1.6 @@ -17,7 +17,7 @@ sx/chunk.o \ sx/client.o \ sx/error.o \ - sx/sasl-server.o \ + sx/sasl.o \ sx/server.o \ sx/sx.o \ c2s.o 1.9 +9 -5 jabberd/c2s-streams/c2s.c Index: c2s.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/c2s.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- c2s.c 27 Aug 2002 23:53:15 -0000 1.8 +++ c2s.c 4 Sep 2002 01:53:13 -0000 1.9 @@ -10,7 +10,11 @@ case event_STREAM: printf("c2s: [%d] got event_STREAM\n", c->fd); - sx_client_handshake(c, "secret"); + + if(c->type == type_CONNECT) + // sx_auth_handshake(c, "secret"); + sx_auth_sasl(c, "jabber-client", "DIGEST-MD5", "rob", "secret"); + break; case event_OPEN: @@ -52,12 +56,12 @@ sx_client_connect(c, "127.0.0.1", 5370); */ - s = sx_server_new(ctx, SX_TYPE_COMPONENT | SX_AUTH_HANDSHAKE, callback, NULL); - //sx_server_setup_sasl(c, "jabber-client", 0); - sx_server_add_peer(s, "foo", NULL, "secret"); + s = sx_server_new(ctx, SX_TYPE_CLIENT | SX_AUTH_SASL, callback, NULL); + sx_server_setup_sasl(s, "jabber-client", 0); + sx_server_add_peer(s, "localhost", NULL, NULL); sx_server_listen(s, "0.0.0.0", 5222); - c = sx_client_new(ctx, "foo", SX_TYPE_COMPONENT | SX_AUTH_HANDSHAKE, callback, NULL); + c = sx_client_new(ctx, "localhost", SX_TYPE_CLIENT | SX_AUTH_SASL, callback, NULL); sx_client_connect(c, "127.0.0.1", 5222); while(1) From rob at jabber.org Tue Sep 3 20:53:15 2002 From: rob at jabber.org (Rob Norris) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberd/c2s-streams/sx sasl.c TODO auth.c client.c conn.c sx.h sasl-server.c Message-ID: <20020904015315.495E863D1A@hades.jabber.org> rob 02/09/03 20:53:15 Modified: c2s-streams/sx TODO auth.c client.c conn.c sx.h Added: c2s-streams/sx sasl.c Removed: c2s-streams/sx sasl-server.c Log: full sasl client and server support, lots of code cleanups Revision Changes Path 1.2 +8 -0 jabberd/c2s-streams/sx/TODO Index: TODO =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TODO 27 Aug 2002 23:53:17 -0000 1.1 +++ TODO 4 Sep 2002 01:53:15 -0000 1.2 @@ -2,3 +2,11 @@ checked to make sure that they don't conflict with any of the inbuilt namespaces. Alternatively, just make a random prefix for any unknown namespace (would need a hashtable for checking). + +- Think about the best way to implement SASL interacts (if we need them + at all). + +- Is stream_SASL_WAIT necessary? It is too ugly to just wait in + stream_CONNECTING until the mechanisms arrive? + +- Need to implement SASL security layers. 1.6 +28 -10 jabberd/c2s-streams/sx/auth.c Index: auth.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/auth.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- auth.c 27 Aug 2002 23:53:17 -0000 1.5 +++ auth.c 4 Sep 2002 01:53:15 -0000 1.6 @@ -19,41 +19,59 @@ return hash; } -int sx_client_handshake(sx_conn_t client, char *secret) +int sx_auth_handshake(sx_conn_t c, char *secret) { char *hash; nad_t nad; - assert((int) client); + assert((int) c); assert((int) secret); /* no point if they haven't asked for us at creation */ - if(!(client->flags & SX_AUTH_HANDSHAKE)) + if(!(c->flags & SX_AUTH_HANDSHAKE)) return 1; /* can only auth if we're in preauth */ - if(client->state != state_STREAM) + if(c->state != state_STREAM) return 1; /* make the hash */ - hash = _sx_gen_handshake(client, secret); + hash = _sx_gen_handshake(c, secret); /* create a new nad */ - nad = sx_nad_new(client); + nad = sx_nad_new(c); nad_append_elem(nad, -1, "handshake", 1); nad_append_cdata(nad, hash, strlen(hash), 2); free(hash); - _sx_debug(ZONE, "handshaking with peer; id=%s, secret=%s", client->stream_id, secret); + _sx_debug(ZONE, "handshaking with peer; id=%s, secret=%s", c->stream_id, secret); /* create a chunk and write it */ - _sx_chunk_write(client, _sx_chunk_new(nad)); + _sx_chunk_write(c, _sx_chunk_new(nad)); /* we're authing */ - _SX_STATE(client, state_AUTH_CLIENT); + _SX_STATE(c, state_AUTH_CLIENT); - client->auth_type = SX_AUTH_HANDSHAKE; + c->auth_type = SX_AUTH_HANDSHAKE; return 0; +} + +int sx_auth_sasl(sx_conn_t c, char *appname, char *mech, char *user, char *pass) +{ + assert((int) c); + assert((int) mech); + assert((int) user); + assert((int) pass); + + /* no point if they haven't asked for us at creation */ + if(!(c->flags & SX_AUTH_SASL)) + return 1; + + /* can only auth if we're in preauth */ + if(c->state != state_STREAM) + return 1; + + return _sx_sasl_auth_start(c, appname, mech, user, pass); } 1.13 +16 -16 jabberd/c2s-streams/sx/client.c Index: client.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/client.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- client.c 27 Aug 2002 23:53:17 -0000 1.12 +++ client.c 4 Sep 2002 01:53:15 -0000 1.13 @@ -1,13 +1,13 @@ #include "sx.h" /* make a new client conn */ -sx_conn_t sx_client_new(sx_ctx_t ctx, char *name, unsigned int flags, sx_callback_t cb, void *arg) +sx_conn_t sx_client_new(sx_ctx_t ctx, char *peer, unsigned int flags, sx_callback_t cb, void *arg) { - sx_conn_t client; + sx_conn_t c; unsigned int type; assert((int) ctx); - assert((int) name); + assert((int) peer); assert((int) cb); /* check flags */ @@ -18,31 +18,31 @@ return NULL; } - client = _sx_conn_new(ctx, 0); + c = _sx_conn_new(ctx, 0); - client->type = type_CONNECT; + c->type = type_CONNECT; - client->peer = (_sx_peer_t) malloc(sizeof(struct _sx_peer_st)); - memset(client->peer, 0, sizeof(struct _sx_peer_st)); + c->peer = (_sx_peer_t) malloc(sizeof(struct _sx_peer_st)); + memset(c->peer, 0, sizeof(struct _sx_peer_st)); - snprintf(client->peer->name, 257, "%s", name); + snprintf(c->peer->name, 257, "%s", peer); - client->flags = flags; + c->flags = flags; /* choose a namespace */ if(flags & SX_TYPE_CLIENT) - client->ns = _SX_NS_CLIENT; + c->ns = _SX_NS_CLIENT; else if(flags & SX_TYPE_SERVER) - client->ns = _SX_NS_SERVER; + c->ns = _SX_NS_SERVER; else if(flags & SX_TYPE_COMPONENT) - client->ns = _SX_NS_COMPONENT; + c->ns = _SX_NS_COMPONENT; - _sx_debug(ZONE, "application namespace: %s", client->ns); + _sx_debug(ZONE, "application namespace: %s", c->ns); - client->callback = cb; - client->cb_arg = arg; + c->callback = cb; + c->cb_arg = arg; - return client; + return c; } /* set up the connection */ 1.10 +135 -86 jabberd/c2s-streams/sx/conn.c Index: conn.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/conn.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- conn.c 27 Aug 2002 23:53:17 -0000 1.9 +++ conn.c 4 Sep 2002 01:53:15 -0000 1.10 @@ -46,7 +46,29 @@ int i; char *id; - /* Extract stream ID and generate a key to hash */ + /* + * 1. check the app namespace, make sure its the same as ours + * 2. extract the stream id, save for later auth + * 3. match features (sasl, starttls), flag appropriately + */ + + /* make sure this is actually a stream start */ + if(strcmp(name, _SX_NS_STREAMS "|stream") != 0) + { + mio_close(c->ctx->mio, c->fd); + _sx_conn_free(c); + return; + } + + /* check the app namespace, it should match one that we're interested in */ + if((c->flags & SX_TYPE_MASK) != (c->peer_flags & SX_TYPE_MASK)) + { + mio_close(c->ctx->mio, c->fd); + _sx_conn_free(c); + return; + } + + /* extract the stream id, and save it for later (handshake, digest, etc) */ i = 0; id = NULL; while(atts[i] != '\0') { @@ -57,12 +79,27 @@ /* !!! if no id, error and close */ - /* save the id for the handshake */ c->stream_id = strdup(id); - /* stream is open */ - _SX_STATE(c, state_STREAM); - _SX_EVENT(c, event_STREAM, NULL); + /* turn off stuff that the server doesn't support */ + if(!(c->peer_flags & SX_AUTH_SASL)) + c->flags &= ~SX_AUTH_SASL; + if(!(c->peer_flags & SX_ENC_STARTTLS)) + c->flags &= ~SX_ENC_STARTTLS; + + /* only change state and fire stream event if we're not doing sasl. + * if we are, the server is about to send us the mechanisms list. since + * auth functions are usually called from the stream event callback, + * there's not much point firing the event until they have enough + * information to do auth */ + if(!(c->flags & SX_AUTH_SASL)) + { + _SX_STATE(c, state_STREAM); + _SX_EVENT(c, event_STREAM, NULL); + } + + else + _SX_STATE(c, state_SASL_WAIT); } /* respond to incoming stream header */ @@ -92,7 +129,7 @@ } /* check the app namespace, it should match one that we're interested in */ - if(!(c->server->flags & (c->flags & SX_TYPE_MASK))) + if(!(c->server->flags & (c->peer_flags & SX_TYPE_MASK))) { mio_close(c->ctx->mio, c->fd); _sx_conn_free(c); @@ -135,23 +172,23 @@ /* if they requested stuff that we're not supporting, turn them off */ if(!(c->server->flags & SX_AUTH_SASL) || c->server->sasl_appname == NULL) - c->flags &= ~SX_AUTH_SASL; + c->peer_flags &= ~SX_AUTH_SASL; if(!(c->server->flags & SX_ENC_STARTTLS)) - c->flags &= ~SX_ENC_STARTTLS; + c->peer_flags &= ~SX_ENC_STARTTLS; /* make sure we can support sasl if they've asked for it */ - if(c->flags & SX_AUTH_SASL) + if(c->peer_flags & SX_AUTH_SASL) { snprintf(local, 24, "%s;%d", c->local_ip, c->local_port); snprintf(remote, 24, "%s;%d", c->remote_ip, c->remote_port); - ret = sasl_server_new(c->server->sasl_appname, c->peer->name, c->peer->realm, local, remote, NULL, 0, &c->sasl_ctx); + ret = sasl_server_new(c->server->sasl_appname, c->peer->name, c->peer->realm[0] != '\0' ? c->peer->realm : NULL, local, remote, NULL, 0, &c->sasl_ctx); if(ret != SASL_OK) { - /* !!! find out if sasl_conn_new() still allocates conn on failure */ - _sx_debug(ZONE, "sasl_conn_new failed (%s), not offering sasl for this connection", sasl_errstring(ret, NULL, NULL)); + /* !!! find out if sasl_server_new() still allocates conn on failure */ + _sx_debug(ZONE, "sasl_server_new failed (%s), not offering sasl for this connection", sasl_errstring(ret, NULL, NULL)); c->sasl_ctx = NULL; - c->flags &= ~SX_AUTH_SASL; + c->peer_flags &= ~SX_AUTH_SASL; } else @@ -163,7 +200,7 @@ sasl_dispose(&c->sasl_ctx); c->sasl_ctx = NULL; - c->flags &= ~SX_AUTH_SASL; + c->peer_flags &= ~SX_AUTH_SASL; } else @@ -175,11 +212,14 @@ shahash_r(NULL, id); c->stream_id = strdup(id); + /* our flags are his flags */ + c->flags = c->peer_flags; + /* figure out the header length */ len = strlen(c->ns) + (strlen(_SX_NS_STREAMS_PREFIX) * 2) + strlen(_SX_NS_STREAMS) + strlen(c->peer->name) + strlen(c->stream_id) + 65; /* optional things */ - if(c->flags & SX_AUTH_SASL) + if(c->peer_flags & SX_AUTH_SASL) { ret = sasl_listmech(c->sasl_ctx, NULL, "<" _SX_NS_SASL_PREFIX ":mechanisms><" _SX_NS_SASL_PREFIX ":mechanism>", @@ -192,7 +232,7 @@ sasl_dispose(&c->sasl_ctx); c->sasl_ctx = NULL; - c->flags &= ~SX_AUTH_SASL; + c->peer_flags &= ~SX_AUTH_SASL; } else if(i <= 0) @@ -201,13 +241,13 @@ sasl_dispose(&c->sasl_ctx); c->sasl_ctx = NULL; - c->flags &= ~SX_AUTH_SASL; + c->peer_flags &= ~SX_AUTH_SASL; } else len += strlen(_SX_NS_SASL) + strlen(_SX_NS_SASL_PREFIX) + 9 + strlen(mechs); } - if(c->flags & SX_ENC_STARTTLS) + if(c->peer_flags & SX_ENC_STARTTLS) len += strlen(_SX_NS_STARTTLS) + strlen(_SX_NS_STARTTLS_PREFIX) + 9; /* build the header */ @@ -216,11 +256,11 @@ "" "<" _SX_NS_STREAMS_PREFIX ":stream xmlns='%s' %s %s xmlns:" _SX_NS_STREAMS_PREFIX "='" _SX_NS_STREAMS "' from='%s' id='%s'>%s", c->ns, - (c->flags & SX_AUTH_SASL) ? "xmlns:" _SX_NS_SASL_PREFIX "='" _SX_NS_SASL "'" : "", - (c->flags & SX_ENC_STARTTLS) ? "xmlns:" _SX_NS_STARTTLS_PREFIX "='" _SX_NS_STARTTLS "'" : "", + (c->peer_flags & SX_AUTH_SASL) ? "xmlns:" _SX_NS_SASL_PREFIX "='" _SX_NS_SASL "'" : "", + (c->peer_flags & SX_ENC_STARTTLS) ? "xmlns:" _SX_NS_STARTTLS_PREFIX "='" _SX_NS_STARTTLS "'" : "", c->peer->name, c->stream_id, - (c->flags & SX_AUTH_SASL) ? mechs : "" + (c->peer_flags & SX_AUTH_SASL) ? mechs : "" ); _sx_debug(ZONE, "about to write stream header: %s", header); @@ -349,27 +389,27 @@ if(strcmp(uri, _SX_NS_CLIENT) == 0) { c->ns = _SX_NS_CLIENT; - c->flags |= SX_TYPE_CLIENT; - c->flags &= ~(SX_TYPE_SERVER & SX_TYPE_COMPONENT); + c->peer_flags |= SX_TYPE_CLIENT; + c->peer_flags &= ~(SX_TYPE_SERVER & SX_TYPE_COMPONENT); } else if(strcmp(uri, _SX_NS_SERVER) == 0) { c->ns = _SX_NS_SERVER; - c->flags |= SX_TYPE_SERVER; - c->flags &= ~(SX_TYPE_CLIENT & SX_TYPE_COMPONENT); + c->peer_flags |= SX_TYPE_SERVER; + c->peer_flags &= ~(SX_TYPE_CLIENT & SX_TYPE_COMPONENT); } else if(strcmp(uri, _SX_NS_COMPONENT) == 0) { c->ns = _SX_NS_COMPONENT; - c->flags |= SX_TYPE_COMPONENT; - c->flags &= ~(SX_TYPE_CLIENT & SX_TYPE_SERVER); + c->peer_flags |= SX_TYPE_COMPONENT; + c->peer_flags &= ~(SX_TYPE_CLIENT & SX_TYPE_SERVER); } /* feature requests */ else if(strcmp(uri, _SX_NS_SASL) == 0) - c->flags |= SX_AUTH_SASL; + c->peer_flags |= SX_AUTH_SASL; else if(strcmp(uri, _SX_NS_STARTTLS) == 0) - c->flags |= SX_ENC_STARTTLS; + c->peer_flags |= SX_ENC_STARTTLS; /* otherwise, just remember it for the future */ else @@ -401,11 +441,13 @@ _sx_debug(ZONE, "completed nad; namespace=%.*s, root=%s", NAD_NURI_L(c->nad, ns), NAD_NURI(c->nad, ns), root); + /* nad_print(c->nad, 0, &out, &len); _sx_debug(ZONE, "nad from 0: %.*s", len, out); nad_print(c->nad, 1, &out, &len); _sx_debug(ZONE, "nad from 1: %.*s", len, out); + */ /* its a response to our auth request */ if(c->state == state_AUTH_CLIENT) @@ -428,96 +470,80 @@ break; case SX_AUTH_SASL: - break; - - case SX_AUTH_DIALBACK: - break; - - default: - /* !!! bounce packet (or abort?) */ - break; - } - - return; - } - - /* they're halfway through authing to us */ - if(c->state == state_AUTH_SERVER) - { - switch(c->auth_type) - { - case SX_AUTH_HANDSHAKE: - break; - - case SX_AUTH_TRADITIONAL: - break; - - case SX_AUTH_SASL: if(strncmp(_SX_NS_SASL, NAD_NURI(c->nad, ns), NAD_NURI_L(c->nad, ns)) == 0) /* break out into a seperate function */ - _sx_server_sasl_process(c, root); + _sx_sasl_process(c, root); + break; case SX_AUTH_DIALBACK: break; default: - /* !!! bounce packet (or fail?) */ + /* !!! bounce packet (or abort?) */ break; } return; } - /* they're starting an auth with us */ - if(c->state == state_STREAM) + /* starting or continuing a multi-step auth */ + if(c->state == state_SASL_WAIT || c->state == state_STREAM || c->state == state_AUTH_SERVER) { /* sasl auth */ if(strncmp(_SX_NS_SASL, NAD_NURI(c->nad, ns), NAD_NURI_L(c->nad, ns)) == 0) { /* break out into a seperate function */ - _sx_server_sasl_process(c, root); + _sx_sasl_process(c, root); return; } - /* handshake auth */ - if(strncmp(c->ns, NAD_NURI(c->nad, ns), NAD_NURI_L(c->nad, ns)) == 0 && strcmp("handshake", root) == 0) + /* single step auth */ + if(c->state == state_STREAM) { - /* make the hash */ - hash = _sx_gen_handshake(c, c->peer->secret); + /* handshake auth */ + if(strncmp(c->ns, NAD_NURI(c->nad, ns), NAD_NURI_L(c->nad, ns)) == 0 && strcmp("handshake", root) == 0) + { + /* make the hash */ + hash = _sx_gen_handshake(c, c->peer->secret); - _sx_debug(ZONE, "checking their hash '%.*s' with our hash '%s'", NAD_CDATA_L(c->nad, 1), NAD_CDATA(c->nad, 1), hash); + _sx_debug(ZONE, "checking their hash '%.*s' with our hash '%s'", NAD_CDATA_L(c->nad, 1), NAD_CDATA(c->nad, 1), hash); - if(strncmp(hash, NAD_CDATA(c->nad, 1), NAD_CDATA_L(c->nad, 1)) == 0) - { - /* matched, they're online */ - if((attr = nad_find_attr(c->nad, 1, -1, "id", NULL)) >= 0) - snprintf(id, 24, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); + if(strncmp(hash, NAD_CDATA(c->nad, 1), NAD_CDATA_L(c->nad, 1)) == 0) + { + /* matched, they're online */ + _sx_debug(ZONE, "matched, they're good"); - nad_free(c->nad); - c->nad = sx_nad_new(c); + if((attr = nad_find_attr(c->nad, 1, -1, "id", NULL)) >= 0) + snprintf(id, 24, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); - nad_append_elem(c->nad, nad_find_scoped_namespace(c->nad, c->ns, NULL), "handshake", 1); + nad_free(c->nad); + c->nad = sx_nad_new(c); - if(attr >= 0) - nad_append_attr(c->nad, -1, "id", id); + nad_append_elem(c->nad, nad_find_scoped_namespace(c->nad, c->ns, NULL), "handshake", 1); - _sx_chunk_write(c, _sx_chunk_new(c->nad)); + if(attr >= 0) + nad_append_attr(c->nad, -1, "id", id); - c->auth_id = strdup(c->peer->name); + _sx_chunk_write(c, _sx_chunk_new(c->nad)); - _SX_STATE(c, state_OPEN); - _SX_EVENT(c, event_OPEN, NULL); - } + c->auth_id = strdup(c->peer->name); - else - /* !!! should probably send an error here */ - c->depth = -1; + _SX_STATE(c, state_OPEN); + _SX_EVENT(c, event_OPEN, NULL); + } - free(hash); + else + /* !!! should probably send an error here */ + c->depth = -1; - return; + free(hash); + + return; + } } + + /* !!! bounce packet, I guess */ } /* real packets */ @@ -529,8 +555,9 @@ int _sx_conn_io(mio_t m, mio_action_t a, int fd, void *data, void *arg) { char buf[1024], *header; /* !!! make static when not threaded? move into conn_st? */ - int len, ret; sx_conn_t c = (sx_conn_t) arg; + struct sockaddr_in sa; + int len, ret, namelen = sizeof(struct sockaddr_in); _sx_debug(ZONE,"io action %d with fd %d",a,fd); @@ -559,11 +586,21 @@ _SX_STATE(c, state_CONNECTED); + /* local ip/port */ + getsockname(fd, (struct sockaddr *) &sa, &namelen); + strncpy(c->local_ip, inet_ntoa(sa.sin_addr), 16); + c->local_port = ntohs(sa.sin_port); + + /* remote ip/port */ + getpeername(fd, (struct sockaddr *) &sa, &namelen); + strncpy(c->remote_ip, inet_ntoa(sa.sin_addr), 16); + c->remote_port = ntohs(sa.sin_port); + /* allow read events */ mio_read(c->ctx->mio, c->fd); /* figure out the header length */ - len = strlen(c->ns) + (strlen(_SX_NS_STREAMS_PREFIX) * 2) + strlen(_SX_NS_STREAMS) + 60; + len = strlen(c->ns) + (strlen(_SX_NS_STREAMS_PREFIX) * 2) + strlen(_SX_NS_STREAMS) + strlen(c->peer->name) + 57; /* optional things */ if(c->flags & SX_AUTH_SASL) @@ -673,11 +710,23 @@ /* free up memory (!caller must process anything in the writeq and call mio_close before calling this) */ void _sx_conn_free(sx_conn_t c) { + int i; + _sx_debug(ZONE, "freeing conn %d", c->fd); if(c->peer != NULL) free(c->peer); + if(c->sasl_mechs != NULL) + { + for(i = 0; i < c->sasl_nmechs; i++) + free(c->sasl_mechs[i]); + free(c->sasl_mechs); + } + if(c->sasl_ctx != NULL) sasl_dispose(&c->sasl_ctx); + + if(c->callbacks[1].context != NULL) free(c->callbacks[1].context); + if(c->callbacks[1].context != NULL) free(c->callbacks[2].context); if(c->auth_id != NULL) free(c->auth_id); 1.12 +20 -7 jabberd/c2s-streams/sx/sx.h Index: sx.h =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/sx.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- sx.h 27 Aug 2002 23:53:17 -0000 1.11 +++ sx.h 4 Sep 2002 01:53:15 -0000 1.12 @@ -73,8 +73,6 @@ sx_conn_t sx_client_new(sx_ctx_t ctx, char *peer, unsigned int flags, sx_callback_t cb, void *arg); int sx_client_connect(sx_conn_t c, char *ip, int port); -int sx_client_handshake(sx_conn_t client, char *secret); - sx_server_t sx_server_new(sx_ctx_t ctx, unsigned int flags, sx_callback_t cb, void *arg); int sx_server_setup_sasl(sx_server_t s, char *appname, int secflags); void sx_server_add_peer(sx_server_t s, char *name, char *realm, char *secret); @@ -82,6 +80,9 @@ int sx_server_shutdown(sx_server_t s); void sx_server_free(sx_server_t s); +int sx_auth_handshake(sx_conn_t c, char *secret); +int sx_auth_sasl(sx_conn_t c, char *appname, char *mech, char *user, char *pass); + void sx_conn_close(sx_conn_t c); char *sx_strerror(int err); @@ -102,7 +103,8 @@ int _sx_conn_write(sx_conn_t c); int _sx_conn_io(mio_t m, mio_action_t a, int fd, void *data, void *arg); -void _sx_server_sasl_process(sx_conn_t c, char *cmd); +void _sx_sasl_process(sx_conn_t c, char *cmd); +int _sx_sasl_auth_start(sx_conn_t c, char *appname, char *mech, char *user, char *pass); char *_sx_gen_handshake(sx_conn_t c, char *secret); @@ -144,6 +146,7 @@ state_CONNECTING, /* connection in progress */ state_CONNECTED, /* connection established */ state_STREAM_START, /* stream start sent */ + state_SASL_WAIT, /* waiting for sasl mechanisms */ state_STREAM, /* stream established */ state_AUTH_CLIENT, /* mid-auth, we're authenticating to them */ state_AUTH_SERVER, /* mid-auth, they're authenticating to us */ @@ -176,16 +179,19 @@ /* peer */ _sx_peer_t peer; - /* flags */ + /* our flags */ unsigned int flags; + /* his flags */ + unsigned int peer_flags; + + /* our namespace */ + char *ns; + /* callback */ sx_callback_t callback; void *cb_arg; - /* application namespace */ - char *ns; - /* auth type */ unsigned int auth_type; @@ -200,11 +206,18 @@ /* server we came from (for accepted conns) */ sx_server_t server; + /* list of mechanisms returned by server */ + char **sasl_mechs; + int sasl_nmechs; + /* sasl context */ sasl_conn_t *sasl_ctx; /* mechanism being use for current sasl auth */ char *sasl_mech; + + /* sasl callbacks */ + sasl_callback_t callbacks[4]; /* authenticated id (username) */ char *auth_id; 1.1 jabberd/c2s-streams/sx/sasl.c Index: sasl.c =================================================================== /* -------------------------------------------------------------------------- * * License * * The contents of this file are subject to the Jabber Open Source License * Version 1.0 (the "JOSL"). You may not copy or use this file, in either * source code or executable form, except in compliance with the JOSL. You * may obtain a copy of the JOSL at http://www.jabber.org/ or at * http://www.opensource.org/. * * Software distributed under the JOSL is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the JOSL * for the specific language governing rights and limitations under the * JOSL. * * Copyrights * * Portions created by or assigned to Jabber.com, Inc. are * Copyright (c) 1999-2002 Jabber.com, Inc. All Rights Reserved. Contact * information for Jabber.com, Inc. is available at http://www.jabber.com/. * * Portions Copyright (c) 1998-1999 Jeremie Miller. * * Acknowledgements * * Special thanks to the Jabber Open Source Contributors for their * suggestions and support of Jabber. * * Alternatively, the contents of this file may be used under the terms of the * GNU General Public License Version 2 or later (the "GPL"), in which case * the provisions of the GPL are applicable instead of those above. If you * wish to allow use of your version of this file only under the terms of the * GPL and not to allow others to use your version of this file under the JOSL, * indicate your decision by deleting the provisions above and replace them * with the notice and other provisions required by the GPL. If you do not * delete the provisions above, a recipient may use your version of this file * under either the JOSL or the GPL. * * --------------------------------------------------------------------------*/ #include "sx.h" /* SASL protocol handler, see JEP-0034 */ /* types for _sx_sasl_client_send */ #define _SX_SASL_SUCCESS (0) #define _SX_SASL_FAILURE (1) #define _SX_SASL_CHALLENGE (2) /* send something to the client; on finish reset sasl state */ static void _sx_sasl_client_send(sx_conn_t c, int type, char *cdata, int cdata_len) { int attr, ns; char id[24]; if((attr = nad_find_attr(c->nad, 1, -1, "id", NULL)) >= 0) snprintf(id, 24, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); nad_free(c->nad); c->nad = sx_nad_new(c); ns = nad_find_scoped_namespace(c->nad, _SX_NS_SASL, NULL); switch(type) { case _SX_SASL_SUCCESS: nad_append_elem(c->nad, ns, "success", 1); /* reset state */ if(c->sasl_mech != NULL) free(c->sasl_mech); c->sasl_mech = NULL; /* all done */ _SX_STATE(c, state_OPEN); _SX_EVENT(c, event_OPEN, NULL); break; case _SX_SASL_FAILURE: nad_append_elem(c->nad, ns, "failure", 1); /* reset state */ if(c->sasl_mech != NULL) free(c->sasl_mech); c->sasl_mech = NULL; /* try again, I dare you */ _SX_STATE(c, state_STREAM); break; case _SX_SASL_CHALLENGE: nad_append_elem(c->nad, ns, "challenge", 1); /* handshaking */ _SX_STATE(c, state_AUTH_SERVER); break; } if(cdata != NULL) nad_append_cdata(c->nad, cdata, cdata_len, 2); if(attr >= 0) nad_set_attr(c->nad, 1, -1, "id", id); /* send it to the client */ _sx_chunk_write(c, _sx_chunk_new(c->nad)); c->nad = NULL; } /* types for _sx_sasl_server_send */ #define _SX_SASL_RESPONSE (0) #define _SX_SASL_ABORT (1) /* send something to the server; on finish reset sasl state */ static void _sx_sasl_server_send(sx_conn_t c, int type, char *cdata, int cdata_len) { int ns; nad_free(c->nad); c->nad = sx_nad_new(c); ns = nad_find_scoped_namespace(c->nad, _SX_NS_SASL, NULL); switch(type) { case _SX_SASL_ABORT: nad_append_elem(c->nad, ns, "abort", 1); /* reset state */ if(c->sasl_mech != NULL) free(c->sasl_mech); c->sasl_mech = NULL; /* try again, I dare you */ _SX_STATE(c, state_STREAM); break; case _SX_SASL_RESPONSE: nad_append_elem(c->nad, ns, "response", 1); /* handshaking */ _SX_STATE(c, state_AUTH_CLIENT); break; } if(cdata != NULL) nad_append_cdata(c->nad, cdata, cdata_len, 2); /* send it to the client */ _sx_chunk_write(c, _sx_chunk_new(c->nad)); c->nad = NULL; } /* decode incoming handshake data */ static int _sx_sasl_in(sx_conn_t c, char **decode, int *decode_len) { char *in, buf[1024]; /* get the response */ if(NAD_CDATA_L(c->nad, 1) > 0) { in = (char *) malloc(sizeof(char) * (NAD_CDATA_L(c->nad, 1) + 1)); snprintf(in, NAD_CDATA_L(c->nad, 1) + 1, "%.*s", NAD_CDATA_L(c->nad, 1), NAD_CDATA(c->nad, 1)); /* validate it */ if(sasl_decode64(in, strlen(in), buf, 1024, decode_len) != SASL_OK) { _sx_debug(ZONE, "malformed data, throwing it out"); free(in); return 1; } free(in); *decode = malloc(sizeof(char) * (*decode_len + 1)); memcpy(*decode, buf, sizeof(char) * *decode_len); } else { *decode = NULL; *decode_len = 0; } return 0; } /* send the current outgoing data from libsasl to the client */ static void _sx_sasl_client_out(sx_conn_t c, int ret, char *out, int out_len) { char buf[1024], *encode, *auth_id; int encode_len; if(ret == SASL_OK) { /* auth succeeded */ _sx_debug(ZONE, "completed, auth successful"); /* get the authenticated auth_id */ sasl_getprop(c->sasl_ctx, SASL_USERNAME, (const void **) &auth_id); c->auth_id = strdup(auth_id); _sx_debug(ZONE, "fd %d authenticated sasl user '%s'", c->fd, auth_id); _sx_sasl_client_send(c, _SX_SASL_SUCCESS, NULL, 0); } else if(ret == SASL_CONTINUE) { /* in progress */ _sx_debug(ZONE, "sending challenge to client: %.*s", out_len, out); /* encode the challenge */ if(out != NULL) { encode = buf; sasl_encode64(out, out_len, encode, 1024, &encode_len); } else { encode = NULL; encode_len = 0; } _sx_sasl_client_send(c, _SX_SASL_CHALLENGE, encode, encode_len); } else { /* auth failed */ _sx_debug(ZONE, "failed"); out = (char *) sasl_errstring(ret, NULL, NULL); _sx_sasl_client_send(c, _SX_SASL_FAILURE, out, strlen(out)); } } /* send the current outgoing data from libsasl to the server */ static void _sx_sasl_server_out(sx_conn_t c, int ret, char *out, int out_len) { char buf[1024], *encode; int encode_len; if(ret == SASL_OK || ret == SASL_CONTINUE) { /* in progress */ _sx_debug(ZONE, "sending response to server: %.*s", out_len, out); /* encode the challenge */ if(out != NULL) { encode = buf; sasl_encode64(out, out_len, encode, 1024, &encode_len); } else { encode = NULL; encode_len = 0; } _sx_sasl_server_send(c, _SX_SASL_RESPONSE, encode, encode_len); } else { /* something went wrong */ _sx_debug(ZONE, "abort"); out = (char *) sasl_errstring(ret, NULL, NULL); _sx_sasl_server_send(c, _SX_SASL_ABORT, out, strlen(out)); } } /* process sasl command nads */ void _sx_sasl_process(sx_conn_t c, char *cmd) { char mech[128], *decode, *out, *auth_id; int elem, attr, ret, decode_len, out_len; _sx_debug(ZONE, "handling sasl packet '%s'", cmd); /* * valid sasl commands (and our state): * client: auth (STREAM), response (AUTH_SERVER), abort (AUTH_SERVER) * server: mechanisms (STREAM_START), challenge (AUTH_CLIENT), success (AUTH_CLIENT), failure (STREAM, AUTH_CLIENT) */ /* starting up */ if(c->state == state_SASL_WAIT) { if(strcmp(cmd, "mechanisms") == 0) { if(c->sasl_mechs != NULL) /* !!! alredy got mechs - bounce the packet? */ return; elem = nad_find_elem(c->nad, 1, NAD_ENS(c->nad, 1), "mechanism", 1); while(elem >= 0) { c->sasl_mechs = (char **) realloc(c->sasl_mechs, sizeof(char *) * (c->sasl_nmechs + 1)); c->sasl_mechs[c->sasl_nmechs] = (char *) malloc(sizeof(char) * (NAD_CDATA_L(c->nad, elem) + 1)); strncpy(c->sasl_mechs[c->sasl_nmechs], NAD_CDATA(c->nad, elem), NAD_CDATA_L(c->nad, elem)); c->sasl_mechs[c->sasl_nmechs][NAD_CDATA_L(c->nad, elem)] = '\0'; _sx_debug(ZONE, "got sasl mechanism: %s", c->sasl_mechs[c->sasl_nmechs]); c->sasl_nmechs++; elem = nad_find_elem(c->nad, elem, NAD_ENS(c->nad, elem), "mechanism", 0); } /* stream open, ready for auth */ _SX_STATE(c, state_STREAM); _SX_EVENT(c, event_STREAM, NULL); return; } } /* starting up */ else if(c->state == state_STREAM) { if(strcmp(cmd, "auth") == 0) { /* get the mechanism */ if((attr = nad_find_attr(c->nad, 1, -1, "mechanism", NULL)) < 0) { _sx_debug(ZONE, "auth request with no mechanism"); _sx_sasl_client_send(c, _SX_SASL_FAILURE, "No mechanism specified", 22); return; } snprintf(mech, 128, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); c->sasl_mech = strdup(mech); _sx_debug(ZONE, "client selected sasl mechanism '%s'", mech); /* decode the incoming data */ if(_sx_sasl_in(c, &decode, &decode_len) != 0) { _sx_sasl_client_send(c, _SX_SASL_FAILURE, "Malformed response", 18); return; } /* start the handshake */ ret = sasl_server_start(c->sasl_ctx, mech, decode, decode_len, (const char **) &out, &out_len); if(decode != NULL) free(decode); _sx_sasl_client_out(c, ret, out, out_len); return; } } /* commands from the client */ else if(c->state == state_AUTH_SERVER) { /* response to our challenge */ if(strcmp(cmd, "response") == 0) { /* decode the incoming data */ if(_sx_sasl_in(c, &decode, &decode_len) != 0) { _sx_sasl_client_send(c, _SX_SASL_FAILURE, "Malformed response", 18); return; } _sx_debug(ZONE, "decoded response data (%d): %.*s", decode_len, decode_len, decode); /* continue the handshake */ ret = sasl_server_step(c->sasl_ctx, decode, decode_len, (const char **) &out, &out_len); if(decode != NULL) free(decode); _sx_sasl_client_out(c, ret, out, out_len); return; } /* abort, nice and easy */ else if(strcmp(cmd, "abort") == 0); { _sx_sasl_client_send(c, _SX_SASL_FAILURE, "Aborted", 7); return; } } /* commands from the server */ else if(c->state == state_AUTH_CLIENT) { if(strcmp(cmd, "challenge") == 0) { /* decode the incoming data */ if(_sx_sasl_in(c, &decode, &decode_len) != 0) { _sx_sasl_client_send(c, _SX_SASL_FAILURE, "Malformed challenge", 19); return; } _sx_debug(ZONE, "decoded response data (%d): %.*s", decode_len, decode_len, decode); /* continue the handshake */ ret = sasl_client_step(c->sasl_ctx, decode, decode_len, NULL, (const char **) &out, &out_len); if(decode != NULL) free(decode); _sx_sasl_server_out(c, ret, out, out_len); return; } else if(strcmp(cmd, "success") == 0) { /* auth succeeded */ _sx_debug(ZONE, "completed, auth successful"); /* get the authenticated auth_id */ sasl_getprop(c->sasl_ctx, SASL_USERNAME, (const void **) &auth_id); c->auth_id = strdup(auth_id); _sx_debug(ZONE, "fd %d authenticated sasl user '%s'", c->fd, auth_id); /* all done */ _SX_STATE(c, state_OPEN); _SX_EVENT(c, event_OPEN, NULL); return; } else if(strcmp(cmd, "failure") == 0) { /* let them know */ _SX_EVENT(c, event_ERROR, (void *) SX_ERR_AUTH_FAILED); /* reset state */ _SX_STATE(c, state_STREAM); /* !!! fire a stream event? */ } } /* they sent a command that we don't support, or we're in the wrong state */ _sx_debug(ZONE, "invalid command '%s' or state %d", cmd, c->state); } static int _sx_sasl_cb_get_simple(void *ctx, int id, const char **result, unsigned *len) { char *val = (char *) ctx; _sx_debug(ZONE, "in _sx_sasl_cb_get_simple (id 0x%x)", id); *result = val; if(len != NULL) *len = strlen(val); return SASL_OK; } static int _sx_sasl_cb_get_secret(sasl_conn_t *conn, void *ctx, int id, sasl_secret_t **psecret) { sasl_secret_t *pass = (sasl_secret_t *) ctx; _sx_debug(ZONE, "in _sx_sasl_cb_get_secret (id 0x%x)", id); /* sanity check */ if(conn == NULL || psecret == NULL || id != SASL_CB_PASS) return SASL_BADPARAM; *psecret = pass; return SASL_OK; } /* kick off the auth handshake (called from sx_auth_sasl) */ int _sx_sasl_auth_start(sx_conn_t c, char *appname, char *mech, char *user, char *pass) { char local[24], remote[24], *out, buf[1024], *encode; int ret, out_len, encode_len, ns; nad_t nad; /* startup */ ret = sasl_client_init(NULL); if(ret != SASL_OK) { _sx_debug(ZONE, "sasl_client_init() failed (%s), not authing", sasl_errstring(ret, NULL, NULL)); return 1; } /* authentication name callback */ c->callbacks[0].id = SASL_CB_AUTHNAME; c->callbacks[0].proc = &_sx_sasl_cb_get_simple; c->callbacks[0].context = strdup(user); /* password callback */ out_len = strlen(pass); c->callbacks[1].id = SASL_CB_PASS; c->callbacks[1].proc = &_sx_sasl_cb_get_secret; c->callbacks[1].context = malloc(sizeof(sasl_secret_t) + out_len); /* fill out the password structure */ ((sasl_secret_t *) c->callbacks[1].context)->len = out_len; memcpy(((sasl_secret_t *) c->callbacks[1].context)->data, pass, out_len + 1); /* user identity callback */ c->callbacks[2].id = SASL_CB_USER; c->callbacks[2].proc = &_sx_sasl_cb_get_simple; c->callbacks[2].context = c->callbacks[0].context; c->callbacks[3].id = SASL_CB_LIST_END; c->callbacks[3].proc = NULL; c->callbacks[3].context = NULL; /* connection to/from */ snprintf(local, 24, "%s;%d", c->local_ip, c->local_port); snprintf(remote, 24, "%s;%d", c->remote_ip, c->remote_port); /* handshake start */ ret = sasl_client_new(appname, c->peer->name, local, remote, c->callbacks, 0, &c->sasl_ctx); if(ret != SASL_OK) { /* !!! find out if sasl_client_new() still allocates conn on failure */ _sx_debug(ZONE, "sasl_client_new failed, (%s), not authing", sasl_errstring(ret, NULL, NULL)); c->sasl_ctx = NULL; free(c->callbacks[1].context); c->callbacks[1].context = NULL; free(c->callbacks[2].context); c->callbacks[2].context = NULL; return 1; } /* first step */ ret = sasl_client_start(c->sasl_ctx, mech, NULL, (const char **) &out, &out_len, NULL); /* !!! merge this with _sx_sasl_server_out and _sx_sasl_server_send */ /* in progress */ _sx_debug(ZONE, "sending auth request to server, mech '%s': %.*s", mech, out_len, out); /* encode the challenge */ if(out != NULL) { encode = buf; sasl_encode64(out, out_len, encode, 1024, &encode_len); } else { encode = NULL; encode_len = 0; } /* build the nad */ nad = sx_nad_new(c); ns = nad_find_scoped_namespace(nad, _SX_NS_SASL, NULL); nad_append_elem(nad, ns, "auth", 1); nad_set_attr(nad, 1, -1, "mechanism", mech); if(encode != NULL) nad_append_cdata(nad, encode, encode_len, 2); _sx_chunk_write(c, _sx_chunk_new(nad)); /* we're authing */ _SX_STATE(c, state_AUTH_CLIENT); c->auth_type = SX_AUTH_SASL; return 0; } From rob at jabber.org Tue Sep 3 23:49:20 2002 From: rob at jabber.org (Rob Norris) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberd/c2s-streams c2s.c Message-ID: <20020904044920.2DD1C63D1A@hades.jabber.org> rob 02/09/03 23:49:20 Modified: c2s-streams c2s.c Log: fire packet events when packets arrive rewrite app namespace on outgoing packets set auth_id correctly after successful handshake cleaned up some chunk / nad handling Revision Changes Path 1.10 +38 -4 jabberd/c2s-streams/c2s.c Index: c2s.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/c2s.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- c2s.c 4 Sep 2002 01:53:13 -0000 1.9 +++ c2s.c 4 Sep 2002 04:49:20 -0000 1.10 @@ -1,5 +1,34 @@ #include "c2s.h" +/* echo messages back to where they came from */ +void packet(sx_ctx_t ctx, sx_conn_t c, nad_t nad, void *arg) +{ + int to, from, ival, lval, ns; + + if(strncmp("message", NAD_ENAME(nad, 1), NAD_ENAME_L(nad, 1)) == 0) + { + to = nad_find_attr(nad, 1, -1, "to", NULL); + from = nad_find_attr(nad, 1, -1, "from", NULL); + + if(to < 0 || from < 0) + return; + + ival = nad->attrs[to].ival; + lval = nad->attrs[to].lval; + + nad->attrs[to].ival = nad->attrs[from].ival; + nad->attrs[to].lval = nad->attrs[from].lval; + + nad->attrs[from].ival = ival; + nad->attrs[from].lval = lval; + + ns = nad_add_namespace(nad, "sx:test", NULL); + nad_append_elem(nad, ns, "test", 2); + + sx_conn_write(c, nad); + } +} + int callback(sx_ctx_t ctx, sx_conn_t c, sx_event_t event, void *data, void *arg) { switch(event) @@ -12,8 +41,8 @@ printf("c2s: [%d] got event_STREAM\n", c->fd); if(c->type == type_CONNECT) - // sx_auth_handshake(c, "secret"); - sx_auth_sasl(c, "jabber-client", "DIGEST-MD5", "rob", "secret"); + sx_auth_handshake(c, "secret"); + ///sx_auth_sasl(c, "jabber-client", "DIGEST-MD5", "rob", "secret"); break; @@ -23,6 +52,9 @@ case event_PACKET: printf("c2s: [%d] got event_PACKET\n", c->fd); + + packet(ctx, c, (nad_t) data, arg); + break; case event_ERROR: @@ -56,13 +88,15 @@ sx_client_connect(c, "127.0.0.1", 5370); */ +/* s = sx_server_new(ctx, SX_TYPE_CLIENT | SX_AUTH_SASL, callback, NULL); sx_server_setup_sasl(s, "jabber-client", 0); sx_server_add_peer(s, "localhost", NULL, NULL); sx_server_listen(s, "0.0.0.0", 5222); +*/ - c = sx_client_new(ctx, "localhost", SX_TYPE_CLIENT | SX_AUTH_SASL, callback, NULL); - sx_client_connect(c, "127.0.0.1", 5222); + c = sx_client_new(ctx, "sx", SX_TYPE_COMPONENT | SX_AUTH_HANDSHAKE, callback, NULL); + sx_client_connect(c, "127.0.0.1", 5370); while(1) mio_run(mio, 5); From rob at jabber.org Tue Sep 3 23:49:21 2002 From: rob at jabber.org (Rob Norris) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberd/c2s-streams/sx auth.c chunk.c conn.c sasl.c sx.c sx.h Message-ID: <20020904044921.C282863D33@hades.jabber.org> rob 02/09/03 23:49:21 Modified: c2s-streams/sx auth.c chunk.c conn.c sasl.c sx.c sx.h Log: fire packet events when packets arrive rewrite app namespace on outgoing packets set auth_id correctly after successful handshake cleaned up some chunk / nad handling Revision Changes Path 1.7 +2 -2 jabberd/c2s-streams/sx/auth.c Index: auth.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/auth.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- auth.c 4 Sep 2002 01:53:15 -0000 1.6 +++ auth.c 4 Sep 2002 04:49:21 -0000 1.7 @@ -39,7 +39,7 @@ hash = _sx_gen_handshake(c, secret); /* create a new nad */ - nad = sx_nad_new(c); + nad = sx_conn_nad(c); nad_append_elem(nad, -1, "handshake", 1); nad_append_cdata(nad, hash, strlen(hash), 2); @@ -48,7 +48,7 @@ _sx_debug(ZONE, "handshaking with peer; id=%s, secret=%s", c->stream_id, secret); /* create a chunk and write it */ - _sx_chunk_write(c, _sx_chunk_new(nad)); + sx_conn_write(c, nad); /* we're authing */ _SX_STATE(c, state_AUTH_CLIENT); 1.3 +24 -0 jabberd/c2s-streams/sx/chunk.c Index: chunk.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/chunk.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- chunk.c 8 Aug 2002 12:29:49 -0000 1.2 +++ chunk.c 4 Sep 2002 04:49:21 -0000 1.3 @@ -20,12 +20,36 @@ free(chunk); } +/* ugly ugly ugly */ +extern int _nad_cdata(nad_t nad, char *cdata, int len); + /* write a chunk to a conn */ void _sx_chunk_write(sx_conn_t c, _sx_chunk_t chunk) { + int ns, len, cdata; + /* don't bother if this chunk is empty */ if(chunk->nad == NULL) + { + _sx_chunk_free(chunk); return; + } + + /* get the application namespace */ + ns = nad_find_namespace(chunk->nad, 0, _SX_NS_CLIENT, NULL); + if(ns < 0) + ns = nad_find_namespace(chunk->nad, 0, _SX_NS_SERVER, NULL); + if(ns < 0) + ns = nad_find_namespace(chunk->nad, 0, _SX_NS_COMPONENT, NULL); + + /* rewrite it if it doesn't match the app namespace for this conn */ + if(strncmp(c->ns, NAD_NURI(chunk->nad, ns), NAD_NURI_L(chunk->nad, ns)) != 0) + { + len = strlen(c->ns); + cdata = _nad_cdata(chunk->nad, c->ns, len); + chunk->nad->nss[ns].iuri = cdata; + chunk->nad->nss[ns].luri = len; + } /* turn the nad into xml */ nad_print(chunk->nad, 1, &chunk->wcur, &chunk->wlen); 1.11 +37 -6 jabberd/c2s-streams/sx/conn.c Index: conn.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/conn.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- conn.c 4 Sep 2002 01:53:15 -0000 1.10 +++ conn.c 4 Sep 2002 04:49:21 -0000 1.11 @@ -301,7 +301,7 @@ /* make a new nad if we don't already have one */ if(c->nad == NULL) - c->nad = sx_nad_new(c); + c->nad = sx_conn_nad(c); /* !!! this is suboptimal - can we do this efficiently without using malloc? */ uri = strdup(name); @@ -420,7 +420,7 @@ /* make a new nad if necessary */ if(c->nad == NULL) - c->nad = sx_nad_new(c); + c->nad = sx_conn_nad(c); /* add it to this nad */ nad_add_namespace(c->nad, (char *) uri, (char *) prefix); @@ -441,13 +441,11 @@ _sx_debug(ZONE, "completed nad; namespace=%.*s, root=%s", NAD_NURI_L(c->nad, ns), NAD_NURI(c->nad, ns), root); - /* nad_print(c->nad, 0, &out, &len); _sx_debug(ZONE, "nad from 0: %.*s", len, out); nad_print(c->nad, 1, &out, &len); _sx_debug(ZONE, "nad from 1: %.*s", len, out); - */ /* its a response to our auth request */ if(c->state == state_AUTH_CLIENT) @@ -459,6 +457,8 @@ { _sx_debug(ZONE, "handshake completed, we're online"); + c->auth_id = strdup(c->peer->name); + /* away we go */ _SX_STATE(c, state_OPEN); _SX_EVENT(c, event_OPEN, NULL); @@ -518,14 +518,14 @@ snprintf(id, 24, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); nad_free(c->nad); - c->nad = sx_nad_new(c); + c->nad = sx_conn_nad(c); nad_append_elem(c->nad, nad_find_scoped_namespace(c->nad, c->ns, NULL), "handshake", 1); if(attr >= 0) nad_append_attr(c->nad, -1, "id", id); - _sx_chunk_write(c, _sx_chunk_new(c->nad)); + sx_conn_write(c, c->nad); c->auth_id = strdup(c->peer->name); @@ -549,6 +549,8 @@ /* real packets */ if(c->state == state_OPEN) _sx_debug(ZONE, "its a packet!"); + + _SX_EVENT(c, event_PACKET, (void *) c->nad); } /* internal handler to read incoming data and parser/process it */ @@ -845,6 +847,35 @@ } } return 0; +} + +/* make a new nad, preinitialised with known namespaces and prefixes */ +nad_t sx_conn_nad(sx_conn_t c) +{ + nad_t nad; + + /* add the default namespaces */ + nad = nad_copy(c->ctx->default_root); + + /* add the app namespace */ + if(c->flags & SX_TYPE_CLIENT) + nad_add_namespace(nad, _SX_NS_CLIENT, NULL); + else if(c->flags & SX_TYPE_SERVER) + nad_add_namespace(nad, _SX_NS_SERVER, NULL); + else + nad_add_namespace(nad, _SX_NS_COMPONENT, NULL); + + /* and bring them all into scope */ + nad_append_elem(nad, -1, "x", 0); + + return nad; +} + +/* simple wrapper to send a nad to a conn */ +/* !!! consider merging fully with _sx_chunk_write and _sx_chunk_new */ +void sx_conn_write(sx_conn_t c, nad_t nad) +{ + _sx_chunk_write(c, _sx_chunk_new(nad)); } void sx_conn_close(sx_conn_t c) 1.2 +6 -6 jabberd/c2s-streams/sx/sasl.c Index: sasl.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/sasl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- sasl.c 4 Sep 2002 01:53:15 -0000 1.1 +++ sasl.c 4 Sep 2002 04:49:21 -0000 1.2 @@ -57,7 +57,7 @@ snprintf(id, 24, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); nad_free(c->nad); - c->nad = sx_nad_new(c); + c->nad = sx_conn_nad(c); ns = nad_find_scoped_namespace(c->nad, _SX_NS_SASL, NULL); @@ -106,7 +106,7 @@ nad_set_attr(c->nad, 1, -1, "id", id); /* send it to the client */ - _sx_chunk_write(c, _sx_chunk_new(c->nad)); + sx_conn_write(c, c->nad); c->nad = NULL; } @@ -120,7 +120,7 @@ int ns; nad_free(c->nad); - c->nad = sx_nad_new(c); + c->nad = sx_conn_nad(c); ns = nad_find_scoped_namespace(c->nad, _SX_NS_SASL, NULL); @@ -152,7 +152,7 @@ nad_append_cdata(c->nad, cdata, cdata_len, 2); /* send it to the client */ - _sx_chunk_write(c, _sx_chunk_new(c->nad)); + sx_conn_write(c, c->nad); c->nad = NULL; } @@ -558,7 +558,7 @@ } /* build the nad */ - nad = sx_nad_new(c); + nad = sx_conn_nad(c); ns = nad_find_scoped_namespace(nad, _SX_NS_SASL, NULL); nad_append_elem(nad, ns, "auth", 1); @@ -567,7 +567,7 @@ if(encode != NULL) nad_append_cdata(nad, encode, encode_len, 2); - _sx_chunk_write(c, _sx_chunk_new(nad)); + sx_conn_write(c, nad); /* we're authing */ _SX_STATE(c, state_AUTH_CLIENT); 1.4 +0 -22 jabberd/c2s-streams/sx/sx.c Index: sx.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/sx.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- sx.c 15 Aug 2002 01:10:04 -0000 1.3 +++ sx.c 4 Sep 2002 04:49:21 -0000 1.4 @@ -33,28 +33,6 @@ free(ctx); } -/* make a new nad, preinitialised with known namespaces and prefixes */ -nad_t sx_nad_new(sx_conn_t c) -{ - nad_t nad; - - /* add the default namespaces */ - nad = nad_copy(c->ctx->default_root); - - /* add the app namespace */ - if(c->flags & SX_TYPE_CLIENT) - nad_add_namespace(nad, _SX_NS_CLIENT, NULL); - else if(c->flags & SX_TYPE_SERVER) - nad_add_namespace(nad, _SX_NS_SERVER, NULL); - else - nad_add_namespace(nad, _SX_NS_COMPONENT, NULL); - - /* and bring them all into scope */ - nad_append_elem(nad, -1, "x", 0); - - return nad; -} - /* debugging */ void __sx_debug(char *file, int line, const char *msgfmt, ...) { 1.13 +2 -2 jabberd/c2s-streams/sx/sx.h Index: sx.h =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/sx.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- sx.h 4 Sep 2002 01:53:15 -0000 1.12 +++ sx.h 4 Sep 2002 04:49:21 -0000 1.13 @@ -83,11 +83,11 @@ int sx_auth_handshake(sx_conn_t c, char *secret); int sx_auth_sasl(sx_conn_t c, char *appname, char *mech, char *user, char *pass); +nad_t sx_conn_nad(sx_conn_t c); +void sx_conn_write(sx_conn_t c, nad_t nad); void sx_conn_close(sx_conn_t c); char *sx_strerror(int err); - -nad_t sx_nad_new(sx_conn_t c); /* internal api */ typedef struct _sx_chunk_st *_sx_chunk_t; From rob at jabber.org Wed Sep 4 00:07:17 2002 From: rob at jabber.org (Rob Norris) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberd/c2s-streams Makefile c2s.c Message-ID: <20020904050717.795B863D1A@hades.jabber.org> rob 02/09/04 00:07:17 Modified: c2s-streams Makefile c2s.c Log: finished server_t interface; more assertions; changes some functions names; reshuffled some code Revision Changes Path 1.7 +0 -1 jabberd/c2s-streams/Makefile Index: Makefile =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Makefile 4 Sep 2002 01:53:13 -0000 1.6 +++ Makefile 4 Sep 2002 05:07:17 -0000 1.7 @@ -16,7 +16,6 @@ sx/conn.o \ sx/chunk.o \ sx/client.o \ - sx/error.o \ sx/sasl.o \ sx/server.o \ sx/sx.o \ 1.11 +1 -1 jabberd/c2s-streams/c2s.c Index: c2s.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/c2s.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- c2s.c 4 Sep 2002 04:49:20 -0000 1.10 +++ c2s.c 4 Sep 2002 05:07:17 -0000 1.11 @@ -25,7 +25,7 @@ ns = nad_add_namespace(nad, "sx:test", NULL); nad_append_elem(nad, ns, "test", 2); - sx_conn_write(c, nad); + sx_nad_write(c, nad); } } From rob at jabber.org Wed Sep 4 00:07:19 2002 From: rob at jabber.org (Rob Norris) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberd/c2s-streams/sx TODO auth.c conn.c sasl.c server.c sx.c sx.h error.c Message-ID: <20020904050719.733AA63D1A@hades.jabber.org> rob 02/09/04 00:07:19 Modified: c2s-streams/sx TODO auth.c conn.c sasl.c server.c sx.c sx.h Removed: c2s-streams/sx error.c Log: finished server_t interface; more assertions; changes some functions names; reshuffled some code Revision Changes Path 1.3 +7 -0 jabberd/c2s-streams/sx/TODO Index: TODO =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TODO 4 Sep 2002 01:53:15 -0000 1.2 +++ TODO 4 Sep 2002 05:07:19 -0000 1.3 @@ -1,3 +1,10 @@ +Things to implement: + +Auth types: SX_AUTH_TRADITIONAL, SX_AUTH_DIALBACK +Encodings: SX_ENC_SSL, SX_ENC_STARTTLS + +Things to check / fix: + - Namespaces declared on the stream header need to have their prefixes checked to make sure that they don't conflict with any of the inbuilt namespaces. Alternatively, just make a random prefix for any unknown 1.8 +2 -2 jabberd/c2s-streams/sx/auth.c Index: auth.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/auth.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- auth.c 4 Sep 2002 04:49:21 -0000 1.7 +++ auth.c 4 Sep 2002 05:07:19 -0000 1.8 @@ -39,7 +39,7 @@ hash = _sx_gen_handshake(c, secret); /* create a new nad */ - nad = sx_conn_nad(c); + nad = sx_nad_new(c); nad_append_elem(nad, -1, "handshake", 1); nad_append_cdata(nad, hash, strlen(hash), 2); @@ -48,7 +48,7 @@ _sx_debug(ZONE, "handshaking with peer; id=%s, secret=%s", c->stream_id, secret); /* create a chunk and write it */ - sx_conn_write(c, nad); + sx_nad_write(c, nad); /* we're authing */ _SX_STATE(c, state_AUTH_CLIENT); 1.12 +20 -15 jabberd/c2s-streams/sx/conn.c Index: conn.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/conn.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- conn.c 4 Sep 2002 04:49:21 -0000 1.11 +++ conn.c 4 Sep 2002 05:07:19 -0000 1.12 @@ -301,7 +301,7 @@ /* make a new nad if we don't already have one */ if(c->nad == NULL) - c->nad = sx_conn_nad(c); + c->nad = sx_nad_new(c); /* !!! this is suboptimal - can we do this efficiently without using malloc? */ uri = strdup(name); @@ -420,7 +420,7 @@ /* make a new nad if necessary */ if(c->nad == NULL) - c->nad = sx_conn_nad(c); + c->nad = sx_nad_new(c); /* add it to this nad */ nad_add_namespace(c->nad, (char *) uri, (char *) prefix); @@ -518,14 +518,14 @@ snprintf(id, 24, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); nad_free(c->nad); - c->nad = sx_conn_nad(c); + c->nad = sx_nad_new(c); nad_append_elem(c->nad, nad_find_scoped_namespace(c->nad, c->ns, NULL), "handshake", 1); if(attr >= 0) nad_append_attr(c->nad, -1, "id", id); - sx_conn_write(c, c->nad); + sx_nad_write(c, c->nad); c->auth_id = strdup(c->peer->name); @@ -849,11 +849,23 @@ return 0; } +void sx_conn_close(sx_conn_t c) +{ + assert((int) c); + + if(c->state < state_CLOSING) + _sx_conn_close(c, NULL); + + _sx_conn_free(c); +} + /* make a new nad, preinitialised with known namespaces and prefixes */ -nad_t sx_conn_nad(sx_conn_t c) +nad_t sx_nad_new(sx_conn_t c) { nad_t nad; + assert((int) c); + /* add the default namespaces */ nad = nad_copy(c->ctx->default_root); @@ -873,17 +885,10 @@ /* simple wrapper to send a nad to a conn */ /* !!! consider merging fully with _sx_chunk_write and _sx_chunk_new */ -void sx_conn_write(sx_conn_t c, nad_t nad) -{ - _sx_chunk_write(c, _sx_chunk_new(nad)); -} - -void sx_conn_close(sx_conn_t c) +void sx_nad_write(sx_conn_t c, nad_t nad) { assert((int) c); + assert((int) nad); - if(c->state < state_CLOSING) - _sx_conn_close(c, NULL); - - _sx_conn_free(c); + _sx_chunk_write(c, _sx_chunk_new(nad)); } 1.3 +6 -6 jabberd/c2s-streams/sx/sasl.c Index: sasl.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/sasl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- sasl.c 4 Sep 2002 04:49:21 -0000 1.2 +++ sasl.c 4 Sep 2002 05:07:19 -0000 1.3 @@ -57,7 +57,7 @@ snprintf(id, 24, "%.*s", NAD_AVAL_L(c->nad, attr), NAD_AVAL(c->nad, attr)); nad_free(c->nad); - c->nad = sx_conn_nad(c); + c->nad = sx_nad_new(c); ns = nad_find_scoped_namespace(c->nad, _SX_NS_SASL, NULL); @@ -106,7 +106,7 @@ nad_set_attr(c->nad, 1, -1, "id", id); /* send it to the client */ - sx_conn_write(c, c->nad); + sx_nad_write(c, c->nad); c->nad = NULL; } @@ -120,7 +120,7 @@ int ns; nad_free(c->nad); - c->nad = sx_conn_nad(c); + c->nad = sx_nad_new(c); ns = nad_find_scoped_namespace(c->nad, _SX_NS_SASL, NULL); @@ -152,7 +152,7 @@ nad_append_cdata(c->nad, cdata, cdata_len, 2); /* send it to the client */ - sx_conn_write(c, c->nad); + sx_nad_write(c, c->nad); c->nad = NULL; } @@ -558,7 +558,7 @@ } /* build the nad */ - nad = sx_conn_nad(c); + nad = sx_nad_new(c); ns = nad_find_scoped_namespace(nad, _SX_NS_SASL, NULL); nad_append_elem(nad, ns, "auth", 1); @@ -567,7 +567,7 @@ if(encode != NULL) nad_append_cdata(nad, encode, encode_len, 2); - sx_conn_write(c, nad); + sx_nad_write(c, nad); /* we're authing */ _SX_STATE(c, state_AUTH_CLIENT); 1.3 +29 -1 jabberd/c2s-streams/sx/server.c Index: server.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/server.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- server.c 27 Aug 2002 23:53:17 -0000 1.2 +++ server.c 4 Sep 2002 05:07:19 -0000 1.3 @@ -157,7 +157,7 @@ _sx_debug(ZONE, "attempting to listen on %s:%d", ip, port); /* attempt to listen */ - if(mio_listen(s->ctx->mio, port, ip, _server_io, (void *) s) < 0) + if((s->fd = mio_listen(s->ctx->mio, port, ip, _server_io, (void *) s)) < 0) { _sx_debug(ZONE, "listen failed"); return 1; @@ -166,4 +166,32 @@ _sx_debug(ZONE, "now listening on %s:%d", ip, port); return 0; +} + +void sx_server_shutdown(sx_server_t s) +{ + assert((int) s); + + _sx_debug(ZONE, "shutting down server fd %d", s->fd); + + mio_close(s->ctx->mio, s->fd); +} + +void sx_server_free(sx_server_t s) +{ + int i; + + assert((int) s); + + if(s->peers != NULL) + { + for(i = 0; i < s->npeers; i++); + free(s->peers[i]); + free(s->peers); + } + + if(s->sasl_appname != NULL) + free(s->sasl_appname); + + free(s); } 1.5 +25 -0 jabberd/c2s-streams/sx/sx.c Index: sx.c =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/sx.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- sx.c 4 Sep 2002 04:49:21 -0000 1.4 +++ sx.c 4 Sep 2002 05:07:19 -0000 1.5 @@ -1,5 +1,28 @@ #include "sx.h" +/* sx error text - these correspond to the SX_ERR defines in sx.h */ +static char *_sx_errors[] = { + "Success", + "Stream error", + "Authentication failed" +}; + +/* error codes are as follows: + * 0x000-0x0ff - SX errors + * 0x100- - Unix errors (errno + 0x100) + */ + +char *sx_strerror(int err) +{ + if(err < SX_ERR_TOP) + return _sx_errors[err]; + + if(err > 0x100) + return strerror(err - 0x100); + + return "Unknown error"; +} + sx_ctx_t sx_new(mio_t m) { sx_ctx_t ctx; @@ -24,6 +47,8 @@ void sx_free(sx_ctx_t ctx) { + assert((int) ctx); + /* !!! close down active conns */ sasl_done(); 1.14 +8 -4 jabberd/c2s-streams/sx/sx.h Index: sx.h =================================================================== RCS file: /home/cvs/jabberd/c2s-streams/sx/sx.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- sx.h 4 Sep 2002 04:49:21 -0000 1.13 +++ sx.h 4 Sep 2002 05:07:19 -0000 1.14 @@ -77,14 +77,15 @@ int sx_server_setup_sasl(sx_server_t s, char *appname, int secflags); void sx_server_add_peer(sx_server_t s, char *name, char *realm, char *secret); int sx_server_listen(sx_server_t s, char *ip, int port); -int sx_server_shutdown(sx_server_t s); +void sx_server_shutdown(sx_server_t s); void sx_server_free(sx_server_t s); int sx_auth_handshake(sx_conn_t c, char *secret); int sx_auth_sasl(sx_conn_t c, char *appname, char *mech, char *user, char *pass); -nad_t sx_conn_nad(sx_conn_t c); -void sx_conn_write(sx_conn_t c, nad_t nad); +nad_t sx_nad_new(sx_conn_t c); +void sx_nad_write(sx_conn_t c, nad_t nad); + void sx_conn_close(sx_conn_t c); char *sx_strerror(int err); @@ -242,6 +243,9 @@ /* context */ sx_ctx_t ctx; + /* file descriptor */ + int fd; + /* valid peers */ _sx_peer_t *peers; int npeers; @@ -283,7 +287,7 @@ #define SX_ERR_STREAM (0x01) #define SX_ERR_AUTH_FAILED (0x02) /* this is a marker for the last error */ -#define SX_ERR_TOP (0x05) +#define SX_ERR_TOP (0x03) /* internal macro for firing the callback */ #define _SX_EVENT(c,e,data) (c->callback)(c->ctx, c, e, data, c->cb_arg) From julian at jabber.org Wed Sep 4 07:50:01 2002 From: julian at jabber.org (Julian Missig) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberoo ChangeLog Message-ID: <20020904125001.D798963D1A@hades.jabber.org> julian 02/09/04 07:50:01 Modified: . ChangeLog Log: Make it actually compile for people with decent compilers ;) Revision Changes Path 1.13 +6 -0 jabberoo/ChangeLog Index: ChangeLog =================================================================== RCS file: /home/cvs/jabberoo/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ChangeLog 1 Sep 2002 03:56:10 -0000 1.12 +++ ChangeLog 4 Sep 2002 12:50:01 -0000 1.13 @@ -1,3 +1,9 @@ +2002-09-04 Julian Missig + + * libjudo/src/XPath.cpp: Make it actually compile for people with decent + * libjudo/src/XPath.h: compilers ;) + * libjudo/src/XPathOps.h: same + 2002-08-31 Thomas Muldowney * libjudo/src/XPath.cpp: Fixed a missed case of node/more_ops From julian at jabber.org Wed Sep 4 07:50:03 2002 From: julian at jabber.org (Julian Missig) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberoo/libjudo/src XPath.cpp XPath.h XPathOps.h Message-ID: <20020904125003.510F563D1A@hades.jabber.org> julian 02/09/04 07:50:03 Modified: libjudo/src XPath.cpp XPath.h XPathOps.h Log: Make it actually compile for people with decent compilers ;) Revision Changes Path 1.3 +8 -8 jabberoo/libjudo/src/XPath.cpp Index: XPath.cpp =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPath.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XPath.cpp 1 Sep 2002 03:56:12 -0000 1.2 +++ XPath.cpp 4 Sep 2002 12:50:03 -0000 1.3 @@ -4,9 +4,9 @@ using namespace judo; using namespace judo::XPath; -int Query::getNextToken(string::size_type& cur) +int Query::getNextToken(std::string::size_type& cur) { - if (cur == string::npos) + if (cur == std::string::npos) return 0; std::list::iterator it = find (_tokens.begin(), _tokens.end(), @@ -80,7 +80,7 @@ { if (token == '/') { - cerr << "Oops, don't handle // yet" << endl; + std::cerr << "Oops, don't handle // yet" << std::endl; return false; } // Otherwise ignore it @@ -129,9 +129,9 @@ } case '\'': pos = _query.find('\'', pos_start); - if (pos == string::npos) + if (pos == std::string::npos) { - cout << "Could not find closing \'" << endl; + std::cout << "Could not find closing \'" << std::endl; return false; } @@ -140,9 +140,9 @@ break; case '\"': pos = _query.find('\"', pos_start); - if (pos == string::npos) + if (pos == std::string::npos) { - cout << "Could not find closing \"" << endl; + std::cout << "Could not find closing \"" << std::endl; return false; } @@ -181,7 +181,7 @@ for(Value::ElemList::iterator it = elems.begin(); it != elems.end(); it++) { - cout << "Ctxt Entry: " << (*it)->toString() << endl; + std::cout << "Ctxt Entry: " << (*it)->toString() << std::endl; } */ return true; 1.2 +4 -2 jabberoo/libjudo/src/XPath.h Index: XPath.h =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPath.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XPath.h 30 Aug 2002 20:05:22 -0000 1.1 +++ XPath.h 4 Sep 2002 12:50:03 -0000 1.2 @@ -1,5 +1,7 @@ #include "judo.hpp" +#include + namespace judo { namespace XPath @@ -79,8 +81,8 @@ break; }; - cout << "OP: type(" << type_str << ") value(" << _value << ")" - << endl; + std::cout << "OP: type(" << type_str << ") value(" << _value << ")" + << std::endl; } protected: 1.2 +8 -6 jabberoo/libjudo/src/XPathOps.h Index: XPathOps.h =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPathOps.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XPathOps.h 30 Aug 2002 20:05:22 -0000 1.1 +++ XPathOps.h 4 Sep 2002 12:50:03 -0000 1.2 @@ -1,3 +1,5 @@ +#include + namespace judo { namespace XPath @@ -16,7 +18,7 @@ for (int x = 1; (x < _pos) && (it != elems.end()); x++) it++; if (it == elems.end()) return false; - cout << "Got position " << (*it)->getName() << endl; + std::cout << "Got position " << (*it)->getName() << std::endl; ctxt = *it; return true; @@ -46,10 +48,10 @@ ++next; Value tmp_ctxt = (*it); - cout << "Context test " << (*it)->toString(); + std::cout << "Context test " << (*it)->toString(); if (!_op->isValid(tmp_ctxt)) { - cout << "...... Invalid" << endl; + std::cout << "...... Invalid" << std::endl; elems.erase(it); } @@ -143,8 +145,8 @@ { if (!_op_lh->isValid(ctxt) || !_op_rh->isValid(ctxt)) return false; - cout << "LH: " << _op_lh->getValue() << endl; - cout << "RH: " << _op_rh->getValue() << endl; + std::cout << "LH: " << _op_lh->getValue() << std::endl; + std::cout << "RH: " << _op_rh->getValue() << std::endl; return (_op_lh->getValue() == _op_rh->getValue()); } @@ -184,7 +186,7 @@ if (elems.empty()) { - cout << "Invalid attribute: " << _value << endl; + std::cout << "Invalid attribute: " << _value << std::endl; return false; } From reatmon at jabber.org Wed Sep 4 14:35:39 2002 From: reatmon at jabber.org (Ryan Eatmon) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jeps/0004 jep-0004.xml Message-ID: <20020904193539.0C64863D1A@hades.jabber.org> reatmon 02/09/04 14:35:38 Modified: 0004 jep-0004.xml Log: more changes Revision Changes Path 1.13 +7 -4 jeps/0004/jep-0004.xml Index: jep-0004.xml =================================================================== RCS file: /home/cvs/jeps/0004/jep-0004.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jep-0004.xml 30 Aug 2002 18:53:28 -0000 1.12 +++ jep-0004.xml 4 Sep 2002 19:35:38 -0000 1.13 @@ -36,7 +36,7 @@ 1.1 - 2002-08-27 + 2002-09-03 rwe Call for Experience changes. @@ -342,7 +342,8 @@

Searching gets a little interesting. There are several issues that pop up when you try to use the jabber:iq:search namespace to return dynamic form information.

First issue, how does the client know which columns to put in the table when it displays the results? Along with the data fields to gather, the jabber:x:data namespace can also tell us which fields will be returned from a search. If we include a short list of <field/>s inside a <reported/> tag with just var='' and label='' attributes, then we have cleanly told the client which fields will map into a report. The <reported/> block will be sent either by itself in a type='result', or in the first result packet from the search. Either way, you can create the results browser at that time and then populate the data as it comes in.

-

Second issue, getting the data returned to the user using the jabber:x:data namespace. The namespace is going to introduce a new tag <item/> that will contain an item of reported data. The <item/> tag will contain fields that define the data that goes with that item. For example:

+

Second, how does the user know what kind of data the field represents? Specifically, how can the user find the JIDs to subscribe to? Basically, since we have field types already defined, just put those field types in the <reported/> section. If a user specifies a type, then you can use it, otherwise assume that it is a text-single and just display the data. See the example below.

+

Third issue, getting the data returned to the user using the jabber:x:data namespace. The namespace is going to introduce a new tag <item/> that will contain an item of reported data. The <item/> tag will contain fields that define the data that goes with that item. For example:

Here is a sample session of how this might work:

<iq type='get' to='bloodbank.jabber.org' id='data2'> @@ -399,7 +400,7 @@ <x xmlns='jabber:x:data' type='result'> <title>BloodBank-Service Search Results</title> <reported> - <field var='jid' label='JID'/> + <field var='jid' label='JID' type='jid'/> <field var='first' label='First'/> <field var='last' label='Last'/> <field var='gender' label='Gender'/> @@ -437,7 +438,7 @@ <x xmlns='jabber:x:data' type='result'> <title>BloodBank-Service Search Results</title> <reported> - <field var='jid' label='JID'/> + <field var='jid' label='JID' type='jid'/> <field var='first' label='First'/> <field var='last' label='Last'/> <field var='gender' label='Gender'/> @@ -577,6 +578,7 @@ <x xmlns='jabber:x:data' type='result'> <title>Users-Agent Search Results</title> <reported> + <field var='jid' label='JID' type='jid'/> <field var='first' label='First (Given)'/> <field var='last' label='Last (Family)'/> <field var='nick' label='Nick (Alias)'/> @@ -794,6 +796,7 @@
  • A <field/> element may now be of type='jid'.
  • Results are reported back in <item/> tags.
  • The <reported/> gets sent with the first set of results.
  • +
  • <reported/> fields also can contain type='' to help explain to the results viewer how to interact with the data. (type='jid' being the most useful).
  • From hildjj at jabber.org Wed Sep 4 16:03:47 2002 From: hildjj at jabber.org (Joe Hildebrand) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus update.bat Message-ID: <20020904210347.8785B63D38@hades.jabber.org> hildjj 02/09/04 16:03:47 Added: . update.bat Log: moved update.bat to new top dir Revision Changes Path 1.1 exodus/update.bat Index: update.bat =================================================================== @echo off cvs -z3 -q update -dP From hildjj at jabber.org Wed Sep 4 16:03:48 2002 From: hildjj at jabber.org (Joe Hildebrand) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus update.bat Message-ID: <20020904210348.A6D1863D38@hades.jabber.org> hildjj 02/09/04 16:03:48 Removed: exodus update.bat Log: moved update.bat to new top dir From hildjj at jabber.org Wed Sep 4 16:22:13 2002 From: hildjj at jabber.org (Joe Hildebrand) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus Exodus.dof Message-ID: <20020904212213.1A39263D1A@hades.jabber.org> hildjj 02/09/04 16:22:13 Modified: exodus Exodus.dof Log: removed old path cruft Revision Changes Path 1.95 +17 -5 exodus/exodus/Exodus.dof Index: Exodus.dof =================================================================== RCS file: /home/cvs/exodus/exodus/Exodus.dof,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- Exodus.dof 3 Sep 2002 00:54:34 -0000 1.94 +++ Exodus.dof 4 Sep 2002 21:22:13 -0000 1.95 @@ -45,10 +45,10 @@ UnitOutputDir=.\output PackageDLLOutputDir= PackageDCPOutputDir= -SearchPath=.\components;.\unicode-comps +SearchPath=.\components Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k;ExComponents -Conditionals=.\output -DebugSourceDirs=D:\Dev\Delphi6\Source\Indy\;D:\src\exodus\components\ +Conditionals= +DebugSourceDirs=D:\Dev\Delphi6\Source\Indy\ UsePackages=0 [Parameters] RunParams=-c poll.xml @@ -66,7 +66,7 @@ MajorVer=0 MinorVer=7 Release=0 -Build=1 +Build=2 Debug=0 PreRelease=0 Special=0 @@ -77,7 +77,7 @@ [Version Info Keys] CompanyName=PeterMillard FileDescription= -FileVersion=0.7.0.1 +FileVersion=0.7.0.2 InternalName= LegalCopyright=Peter Millard, 2002 LegalTrademarks= @@ -85,3 +85,15 @@ ProductName=Exodus ProductVersion=1.0.0.0 Comments=This is free! Promote jabber and give it to a friend. +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=D:\Dev\Delphi6\Source\Indy\ +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=1 +Item0=.\components +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=.\output From pgmillard at jabber.org Wed Sep 4 16:36:43 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus Exodus.res Exodus.tlb Message-ID: <20020904213643.9665C63D1A@hades.jabber.org> pgmillard 02/09/04 16:36:43 Modified: exodus Exodus.res Exodus.tlb Log: Something is amiss w/ these binary files... bringing them up to date Revision Changes Path 1.109 +1 -1 exodus/exodus/Exodus.res Index: Exodus.res =================================================================== RCS file: /home/cvs/exodus/exodus/Exodus.res,v retrieving revision 1.108 retrieving revision 1.109 diff -u -r1.108 -r1.109 Binary files /tmp/cvsHs67SI and /tmp/cvsqB0gyh differ 1.5 +1 -1 exodus/exodus/Exodus.tlb Index: Exodus.tlb =================================================================== RCS file: /home/cvs/exodus/exodus/Exodus.tlb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 Binary files /tmp/cvsUmNUeK and /tmp/cvsoxvoik differ From reatmon at jabber.org Wed Sep 4 21:55:56 2002 From: reatmon at jabber.org (Ryan Eatmon) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: netjabber/Jabber Protocol.pm Message-ID: <20020905025556.E2B1363D1A@hades.jabber.org> reatmon 02/09/04 21:55:56 Modified: Jabber Protocol.pm Log: minor presence callback tweaks Revision Changes Path 1.64 +21 -1 netjabber/Jabber/Protocol.pm Index: Protocol.pm =================================================================== RCS file: /home/cvs/netjabber/Jabber/Protocol.pm,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- Protocol.pm 28 Aug 2002 04:11:03 -0000 1.63 +++ Protocol.pm 5 Sep 2002 02:55:56 -0000 1.64 @@ -3481,7 +3481,8 @@ message=>sub{ $self->callbackMessage(@_) }, ); - $self->SetPresenceCallBacks(subscribe=>sub{ $self->callbackPresenceSubscribe(@_) }, + $self->SetPresenceCallBacks(available=>sub{ $self->callbackPresenceAvailable(@_) }, + subscribe=>sub{ $self->callbackPresenceSubscribe(@_) }, unsubscribe=>sub{ $self->callbackPresenceUnsubscribe(@_) }, subscribed=>sub{ $self->callbackPresenceSubscribed(@_) }, unsubscribed=>sub{ $self->callbackPresenceUnsubscribed(@_) }, @@ -3585,6 +3586,23 @@ ############################################################################### # +# callbackPresenceAvailable - default callback for available packets. +# +############################################################################### +sub callbackPresenceAvailable +{ + shift; + my $self = shift; + my $sid = shift; + my $presence = shift; + + my $reply = $presence->Reply(); + $self->Send($reply,1); +} + + +############################################################################### +# # callbackPresenceSubscribe - default callback for subscribe packets. # ############################################################################### @@ -3596,6 +3614,8 @@ my $presence = shift; my $reply = $presence->Reply(type=>"subscribed"); + $self->Send($reply,1); + $reply->SetType("subscribe"); $self->Send($reply,1); } From temas at jabber.org Wed Sep 4 22:41:03 2002 From: temas at jabber.org (Thomas Muldowney) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberoo/libjudo/src XPath.cpp XPath.h XPathOps.h Message-ID: <20020905034103.20F0263D1A@hades.jabber.org> temas 02/09/04 22:41:03 Modified: libjudo/src XPath.cpp XPath.h XPathOps.h Log: New parser New ops: and, or Revision Changes Path 1.4 +111 -97 jabberoo/libjudo/src/XPath.cpp Index: XPath.cpp =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPath.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- XPath.cpp 4 Sep 2002 12:50:03 -0000 1.3 +++ XPath.cpp 5 Sep 2002 03:41:02 -0000 1.4 @@ -25,137 +25,151 @@ return *it; } -Op* Query::getOp(int token, std::string::size_type pos_start, - std::string::size_type pos_end) +std::string Query::getNextIdentifier(string::size_type& pos) { - Op* ret_op; - switch(token) - { - case '/': - ret_op = new NodeOp(_query.substr(pos_start, pos_end - pos_start), - (pos_start == 1 ? true : false)); - break; - case '@': - ret_op = new AttributeOp(_query.substr(pos_start, pos_end - - pos_start)); - break; - case '\"': - case '\'': - ret_op = new Op(Op::OP_LITERAL, _query.substr(pos_start, pos_end - - pos_start)); - }; - - return ret_op; + string::size_type sp = pos; + getNextToken(pos); + return _query.substr(sp, pos - sp); } -bool Query::parseQuery() +Op* Query::getOp(std::string::size_type& pos, bool in_context) { - std::string::size_type pos = 0, pos_start = 0; - int token = 0, missed_token = 0; + Op* ret_op = NULL; - // This should always get us a token - token = getNextToken(pos); - if (!token) + do { - // it's just a string of a node - _ops.push_back(new NodeOp(_query, true)); - return true; - } - - // No starting token case - if (pos > 1) - { - _ops.push_back(new NodeOp(_query.substr(0, pos), true)); - } + Op* tmp_op = NULL; + string::size_type pos_start = pos; + char token = getNextToken(pos); + // If we are in a context and get a token barf + if (token == 0 && in_context) + throw Invalid(); + string::size_type token_start = ++pos; + string ident; - while(token) - { - pos_start = ++pos; + // Get rid of the whitespace switch(token) { case '/': - token = getNextToken(pos); - // Possible // - if (pos == pos_start) + if (_query[token_start] == '/') { - if (token == '/') - { - std::cerr << "Oops, don't handle // yet" << std::endl; - return false; - } - // Otherwise ignore it + cerr << "Unhandled all node call" << endl; + pos++; } else { - _ops.push_back(getOp('/', pos_start, pos)); + ret_op = new NodeOp(getNextIdentifier(pos), + (pos_start == 0 ? true : false)); } break; case '@': - getNextToken(pos); - _ops.push_back(getOp(token, pos_start, pos)); + ret_op = new AttributeOp(getNextIdentifier(pos)); break; - case '=': - { - token = getNextToken(pos); - pos_start = ++pos; - getNextToken(pos); - Op* op_rh = getOp(token, pos_start, pos); - Op* op_lh = _ops.back(); - _ops.pop_back(); - _ops.push_back(new EqualOp(op_lh, op_rh)); + case ']': + if (in_context) + { + ret_op = _ops.back(); + _ops.pop_back(); + in_context = false; + } + else + { + cerr << "Found ']' but not in context" << endl; + throw Invalid(); + } + break; + case '\'': + case '\"': + pos = _query.find(token, token_start); + ret_op = new Op(Op::OP_LITERAL, _query.substr(token_start, pos - + token_start)); pos++; - break; - } + case ' ': + ident = _query.substr(pos_start, pos - pos_start - 1); + if (ident == "and") + { + tmp_op = getOp(pos, true); + ret_op = new AndOp(_ops.back(), tmp_op); + in_context = false; + _ops.pop_back(); + } + else if(ident == "or") + { + tmp_op = getOp(pos, true); + ret_op = new OrOp(_ops.back(), tmp_op); + in_context = false; + _ops.pop_back(); + } + break; case '[': - token = getNextToken(pos); - if (token == ']') + // See if we have a position op + if (getNextToken(pos) == ']') { - int val = atoi(_query.substr(pos_start, pos).c_str()); + pos = token_start; + int val = atoi(getNextIdentifier(pos).c_str()); if (val > 0) { - _ops.push_back(new PositionOp(val)); - pos++; + ret_op = new PositionOp(val); + } + else + { + cerr << "Parse error" << endl; + throw Invalid(); } } - break; - case ']': - { - Op* op = _ops.back(); - _ops.pop_back(); - _ops.push_back(new ContextOp(op)); - - break; - } - case '\'': - pos = _query.find('\'', pos_start); - if (pos == std::string::npos) + else { - std::cout << "Could not find closing \'" << std::endl; - return false; + pos = pos_start + 1; + ret_op = new ContextOp(getOp(pos, true)); } - - _ops.push_back(getOp(token, pos_start, pos)); - pos++; break; - case '\"': - pos = _query.find('\"', pos_start); - if (pos == std::string::npos) - { - std::cout << "Could not find closing \"" << std::endl; - return false; - } - - _ops.push_back(getOp(token, pos_start, pos)); - pos++; + case '(': + cout << "call function " << _query.substr(pos_start, token_start - + pos_start - 1) << endl; + ret_op = NULL; + break; + case ')': + cout << "Should take last op and add it as an argument" << endl; + ret_op = NULL; break; + case '=': + while (!tmp_op) + tmp_op = getOp(pos); + ret_op = new EqualOp(_ops.back(), tmp_op); + _ops.pop_back(); + break; default: - printf("Should handle %c\n", token); + cerr << "Unhandled \"" << token << "\"" << endl; + ret_op = NULL; break; }; - token = getNextToken(pos); + if (in_context) + { + if (ret_op) + _ops.push_back(ret_op); + ret_op = NULL; + } + + } while (in_context); + + return ret_op; +} + +bool Query::parseQuery() +{ + Op* op = NULL; + string::size_type pos = 0; + + while (pos < _query.length()) + { + op = getOp(pos); + if (op) + { + _ops.push_back(op); + } } return true; @@ -176,7 +190,7 @@ } } - /* XXX DEBUG + /* XXX DEBUG Value::ElemList elems = ctxt.getList(); for(Value::ElemList::iterator it = elems.begin(); it != elems.end(); it++) 1.3 +12 -6 jabberoo/libjudo/src/XPath.h Index: XPath.h =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPath.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XPath.h 4 Sep 2002 12:50:03 -0000 1.2 +++ XPath.h 5 Sep 2002 03:41:02 -0000 1.3 @@ -36,7 +36,9 @@ OP_CONTEXT_CONDITION, OP_LITERAL, OP_POSITION, - OP_EQUAL + OP_EQUAL, + OP_AND, + OP_OR }; Op(Type op, const std::string& value) : @@ -96,12 +98,16 @@ _query(query) { _tokens.push_back('/'); - _tokens.push_back('\''); - _tokens.push_back('\"'); - _tokens.push_back('@'); _tokens.push_back('['); _tokens.push_back(']'); + _tokens.push_back('@'); + _tokens.push_back('\"'); + _tokens.push_back('\''); _tokens.push_back('='); + _tokens.push_back('('); + _tokens.push_back(')'); + _tokens.push_back(':'); + _tokens.push_back(' '); if (!parseQuery()) throw Invalid(); @@ -127,8 +133,8 @@ bool parseQuery(); int getNextToken(std::string::size_type& cur); - Op* getOp(int token, std::string::size_type pos_start, - std::string::size_type pos_end); + std::string getNextIdentifier(string::size_type& pos); + Op* getOp(std::string::size_type& pos, bool in_context = false); }; }; 1.3 +51 -3 jabberoo/libjudo/src/XPathOps.h Index: XPathOps.h =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPathOps.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XPathOps.h 4 Sep 2002 12:50:03 -0000 1.2 +++ XPathOps.h 5 Sep 2002 03:41:02 -0000 1.3 @@ -48,10 +48,8 @@ ++next; Value tmp_ctxt = (*it); - std::cout << "Context test " << (*it)->toString(); if (!_op->isValid(tmp_ctxt)) { - std::cout << "...... Invalid" << std::endl; elems.erase(it); } @@ -145,8 +143,10 @@ { if (!_op_lh->isValid(ctxt) || !_op_rh->isValid(ctxt)) return false; + /* std::cout << "LH: " << _op_lh->getValue() << std::endl; std::cout << "RH: " << _op_rh->getValue() << std::endl; + */ return (_op_lh->getValue() == _op_rh->getValue()); } @@ -186,7 +186,7 @@ if (elems.empty()) { - std::cout << "Invalid attribute: " << _value << std::endl; + //std::cout << "Invalid attribute: " << _value << std::endl; return false; } @@ -194,6 +194,54 @@ } private: std::string _val; + }; + + class AndOp : public Op + { + public: + AndOp(Op* lh, Op* rh) : Op(OP_AND, "and"), _lh(lh), _rh(rh) + { } + + ~AndOp() + { + delete _lh; + delete _rh; + } + + bool isValid(XPath::Value& ctxt) + { + if (_lh->isValid(ctxt) && _rh->isValid(ctxt)) + return true; + else + return false; + } + private: + Op* _lh; + Op* _rh; + }; + + class OrOp : public Op + { + public: + OrOp(Op* lh, Op* rh) : Op(OP_OR, "or"), _lh(lh), _rh(rh) + { } + + ~OrOp() + { + delete _lh; + delete _rh; + } + + bool isValid(XPath::Value& ctxt) + { + if (_lh->isValid(ctxt) || _rh->isValid(ctxt)) + return true; + else + return false; + } + private: + Op* _lh; + Op* _rh; }; }; }; From temas at jabber.org Thu Sep 5 02:07:19 2002 From: temas at jabber.org (Thomas Muldowney) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberoo ChangeLog Message-ID: <20020905070719.C2C4963D38@hades.jabber.org> temas 02/09/05 02:07:19 Modified: . ChangeLog Log: Bug fixes, better interface, stress tested a bit Revision Changes Path 1.14 +9 -0 jabberoo/ChangeLog Index: ChangeLog =================================================================== RCS file: /home/cvs/jabberoo/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ChangeLog 4 Sep 2002 12:50:01 -0000 1.13 +++ ChangeLog 5 Sep 2002 07:07:19 -0000 1.14 @@ -1,3 +1,12 @@ +2002-09-05 Thomas Muldowney + + * libjudo/src/XPath.cpp: Changed the parser around and fixed some bugs + * libjudo/src/Xpath.h: same + * libjudo/src/XpathOps.h: added ops: or, and + * src/jabberoo-session.cpp: Changed to use the new two list system, added + the unregisterXpath() call. + * include/jabberoo.h: same + 2002-09-04 Julian Missig * libjudo/src/XPath.cpp: Make it actually compile for people with decent From temas at jabber.org Thu Sep 5 02:07:20 2002 From: temas at jabber.org (Thomas Muldowney) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberoo/include jabberoo.hh Message-ID: <20020905070720.00B7A63D38@hades.jabber.org> temas 02/09/05 02:07:20 Modified: include jabberoo.hh Log: Bug fixes, better interface, stress tested a bit Revision Changes Path 1.8 +12 -2 jabberoo/include/jabberoo.hh Index: jabberoo.hh =================================================================== RCS file: /home/cvs/jabberoo/include/jabberoo.hh,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jabberoo.hh 30 Aug 2002 20:05:20 -0000 1.7 +++ jabberoo.hh 5 Sep 2002 07:07:20 -0000 1.8 @@ -991,8 +991,16 @@ * The callback will be called with any packets that match the given XPath query. * @param query The xpath query to search on * @param f the function to call + * @return The id of the registered XPath */ - void registerXPath(const string& query, ElementCallbackFunc f); + XPath::Query* registerXPath(const string& query, ElementCallbackFunc f); + + /** + * Unregister a XPath callback + * + * @param id The id to remove + */ + void unregisterXPath(XPath::Query* id); /** * Query a namespace on a specific JabberID. @@ -1209,7 +1217,9 @@ bool _Authenticate; // Structures multimap _Callbacks; /* IQ callback funcs */ - list > _XPCallbacks; + list _XPaths; + map _XPCallbacks; + // Internal IQ handlers void IQHandler_Auth(const Element& t); void IQHandler_CreateUser(const Element& t); From temas at jabber.org Thu Sep 5 02:07:22 2002 From: temas at jabber.org (Thomas Muldowney) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberoo/libjudo/src XPath.cpp XPath.h XPathOps.h Message-ID: <20020905070722.4C5F463D38@hades.jabber.org> temas 02/09/05 02:07:22 Modified: libjudo/src XPath.cpp XPath.h XPathOps.h Log: Bug fixes, better interface, stress tested a bit Revision Changes Path 1.5 +10 -4 jabberoo/libjudo/src/XPath.cpp Index: XPath.cpp =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPath.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- XPath.cpp 5 Sep 2002 03:41:02 -0000 1.4 +++ XPath.cpp 5 Sep 2002 07:07:22 -0000 1.5 @@ -1,18 +1,19 @@ #include "XPath.h" #include "XPathOps.h" +using namespace std; using namespace judo; using namespace judo::XPath; -int Query::getNextToken(std::string::size_type& cur) +char Query::getNextToken(string::size_type& cur) { if (cur == std::string::npos) return 0; - std::list::iterator it = find (_tokens.begin(), _tokens.end(), + std::list::iterator it = find (_tokens.begin(), _tokens.end(), _query[cur]);; - while (!*it) + while (it == _tokens.end()) { cur++; if (cur > _query.length()) @@ -90,6 +91,11 @@ if (ident == "and") { tmp_op = getOp(pos, true); + if (!tmp_op) + { + cerr << "Invalid and operation" << endl; + throw Invalid(); + } ret_op = new AndOp(_ops.back(), tmp_op); in_context = false; _ops.pop_back(); @@ -183,9 +189,9 @@ for (;it != _ops.end(); it++) { - //(*it)->display(); if (!(*it)->isValid(ctxt)) { + //(*it)->display(); return false; } } 1.4 +2 -2 jabberoo/libjudo/src/XPath.h Index: XPath.h =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPath.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- XPath.h 5 Sep 2002 03:41:02 -0000 1.3 +++ XPath.h 5 Sep 2002 07:07:22 -0000 1.4 @@ -127,12 +127,12 @@ class Invalid{}; private: - std::list _tokens; + std::list _tokens; std::string _query; std::list _ops; bool parseQuery(); - int getNextToken(std::string::size_type& cur); + char getNextToken(std::string::size_type& cur); std::string getNextIdentifier(string::size_type& pos); Op* getOp(std::string::size_type& pos, bool in_context = false); 1.4 +1 -1 jabberoo/libjudo/src/XPathOps.h Index: XPathOps.h =================================================================== RCS file: /home/cvs/jabberoo/libjudo/src/XPathOps.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- XPathOps.h 5 Sep 2002 03:41:02 -0000 1.3 +++ XPathOps.h 5 Sep 2002 07:07:22 -0000 1.4 @@ -18,7 +18,7 @@ for (int x = 1; (x < _pos) && (it != elems.end()); x++) it++; if (it == elems.end()) return false; - std::cout << "Got position " << (*it)->getName() << std::endl; + //std::cout << "Got position " << (*it)->getName() << std::endl; ctxt = *it; return true; From temas at jabber.org Thu Sep 5 02:07:23 2002 From: temas at jabber.org (Thomas Muldowney) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jabberoo/src jabberoo-session.cc Message-ID: <20020905070723.B2EA763D38@hades.jabber.org> temas 02/09/05 02:07:23 Modified: src jabberoo-session.cc Log: Bug fixes, better interface, stress tested a bit Revision Changes Path 1.7 +9 -6 jabberoo/src/jabberoo-session.cc Index: jabberoo-session.cc =================================================================== RCS file: /home/cvs/jabberoo/src/jabberoo-session.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jabberoo-session.cc 30 Aug 2002 20:05:24 -0000 1.6 +++ jabberoo-session.cc 5 Sep 2002 07:07:23 -0000 1.7 @@ -187,9 +187,12 @@ _Callbacks.insert(make_pair(id, f)); } -void Session::registerXPath(const string& query, ElementCallbackFunc f) +XPath::Query* Session::registerXPath(const string& query, + ElementCallbackFunc f) { - _XPCallbacks.push_front(make_pair(new XPath::Query(query), f)); + XPath::Query* xpq = new XPath::Query(query); + _XPaths.push_front(xpq); + _XPCallbacks.insert(make_pair(xpq, f)); } void Session::queryNamespace(const string& nspace, ElementCallbackFunc f, const string& to) @@ -347,12 +350,12 @@ { Element& tref = *t; // See if a xpath handles this - typedef list >::iterator IT; - for (IT it = _XPCallbacks.begin(); it != _XPCallbacks.end(); it++) + typedef list::iterator IT; + for (IT it = _XPaths.begin(); it != _XPaths.end(); it++) { - if ((*it).first->execute(t)) + if ((*it)->execute(t)) { - (*it).second(tref); + _XPCallbacks[(*it)](tref); } } // Determine what kind of packet we recv'd and call the From pgmillard at jabber.org Thu Sep 5 08:17:02 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus CustomPres.dfm CustomPres.pas Exodus.dof Exodus.res Exodus.tlb jud.dfm jud.pas Message-ID: <20020905131702.D66DD63D39@hades.jabber.org> pgmillard 02/09/05 08:17:02 Modified: exodus CustomPres.dfm CustomPres.pas Exodus.dof Exodus.res Exodus.tlb jud.dfm jud.pas Log: Fixed JUD and custom presence forms with Action := caFree Revision Changes Path 1.5 +1 -0 exodus/exodus/CustomPres.dfm Index: CustomPres.dfm =================================================================== RCS file: /home/cvs/exodus/exodus/CustomPres.dfm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- CustomPres.dfm 27 Aug 2002 05:19:05 -0000 1.4 +++ CustomPres.dfm 5 Sep 2002 13:17:02 -0000 1.5 @@ -13,6 +13,7 @@ Font.Style = [] OldCreateOrder = False Position = poMainFormCenter + OnClose = FormClose OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 1.7 +8 -0 exodus/exodus/CustomPres.pas Index: CustomPres.pas =================================================================== RCS file: /home/cvs/exodus/exodus/CustomPres.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- CustomPres.pas 27 Aug 2002 05:19:05 -0000 1.6 +++ CustomPres.pas 5 Sep 2002 13:17:02 -0000 1.7 @@ -44,6 +44,7 @@ procedure frameButtons1btnOKClick(Sender: TObject); procedure frameButtons1btnCancelClick(Sender: TObject); procedure chkSaveClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); private { Private declarations } public @@ -146,6 +147,13 @@ txtTitle.Enabled := e; lblHotkey.Enabled := e; txtHotkey.Enabled := e; +end; + +{---------------------------------------} +procedure TfrmCustomPres.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + Action := caFree; end; end. 1.96 +3 -3 exodus/exodus/Exodus.dof Index: Exodus.dof =================================================================== RCS file: /home/cvs/exodus/exodus/Exodus.dof,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- Exodus.dof 4 Sep 2002 21:22:13 -0000 1.95 +++ Exodus.dof 5 Sep 2002 13:17:02 -0000 1.96 @@ -51,7 +51,7 @@ DebugSourceDirs=D:\Dev\Delphi6\Source\Indy\ UsePackages=0 [Parameters] -RunParams=-c poll.xml +RunParams=-d -c poll.xml HostApplication= Launcher= UseLauncher=0 @@ -66,7 +66,7 @@ MajorVer=0 MinorVer=7 Release=0 -Build=2 +Build=3 Debug=0 PreRelease=0 Special=0 @@ -77,7 +77,7 @@ [Version Info Keys] CompanyName=PeterMillard FileDescription= -FileVersion=0.7.0.2 +FileVersion=0.7.0.3 InternalName= LegalCopyright=Peter Millard, 2002 LegalTrademarks= 1.110 +1 -1 exodus/exodus/Exodus.res Index: Exodus.res =================================================================== RCS file: /home/cvs/exodus/exodus/Exodus.res,v retrieving revision 1.109 retrieving revision 1.110 diff -u -r1.109 -r1.110 Binary files /tmp/cvsOckFjY and /tmp/cvsgbphiM differ 1.6 +1 -1 exodus/exodus/Exodus.tlb Index: Exodus.tlb =================================================================== RCS file: /home/cvs/exodus/exodus/Exodus.tlb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 Binary files /tmp/cvsfPITxZ and /tmp/cvsebdfUO differ 1.12 +10 -9 exodus/exodus/jud.dfm Index: jud.dfm =================================================================== RCS file: /home/cvs/exodus/exodus/jud.dfm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- jud.dfm 2 Sep 2002 23:51:40 -0000 1.11 +++ jud.dfm 5 Sep 2002 13:17:02 -0000 1.12 @@ -6,6 +6,7 @@ BorderWidth = 3 Caption = 'Search for Contacts' OldCreateOrder = True + OnClose = FormClose PixelsPerInch = 96 TextHeight = 13 object pnlLeft: TPanel @@ -18,7 +19,7 @@ TabOrder = 0 object lblInstructions: TLabel Left = 0 - Top = 96 + Top = 70 Width = 200 Height = 26 Align = alTop @@ -30,7 +31,7 @@ Left = 0 Top = 0 Width = 200 - Height = 39 + Height = 26 Align = alTop Caption = 'Select the user database or enter in the Jabber ID of the search' + @@ -39,9 +40,9 @@ end object lblWait: TLabel Left = 0 - Top = 70 + Top = 57 Width = 200 - Height = 26 + Height = 13 Align = alTop Caption = 'Please wait. Contacting search agent:' Visible = False @@ -49,7 +50,7 @@ end object Panel1: TPanel Left = 0 - Top = 39 + Top = 26 Width = 200 Height = 31 Align = alTop @@ -96,16 +97,16 @@ end object pnlFields: TPanel Left = 0 - Top = 276 + Top = 250 Width = 200 - Height = 21 + Height = 47 Align = alClient BevelOuter = bvNone TabOrder = 1 end object aniWait: TAnimate Left = 0 - Top = 122 + Top = 96 Width = 200 Height = 50 Align = alTop @@ -116,7 +117,7 @@ end object pnlResults: TPanel Left = 0 - Top = 172 + Top = 146 Width = 200 Height = 104 Align = alTop 1.17 +7 -0 exodus/exodus/jud.pas Index: jud.pas =================================================================== RCS file: /home/cvs/exodus/exodus/jud.pas,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- jud.pas 2 Sep 2002 23:15:58 -0000 1.16 +++ jud.pas 5 Sep 2002 13:17:02 -0000 1.17 @@ -77,6 +77,7 @@ const FindString: String; const FindPosition: TPoint; FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean; var Index: Integer); + procedure FormClose(Sender: TObject; var Action: TCloseAction); private { Private declarations } field_set: TStringList; @@ -813,5 +814,11 @@ end; end; + +procedure TfrmJUD.FormClose(Sender: TObject; var Action: TCloseAction); +begin + inherited; + Action := caFree; +end; end. From pgmillard at jabber.org Thu Sep 5 08:18:45 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus About.dfm Message-ID: <20020905131845.E372163D39@hades.jabber.org> pgmillard 02/09/05 08:18:45 Modified: exodus About.dfm Log: Centered Exodus logo on about screen Revision Changes Path 1.6 +1 -0 exodus/exodus/About.dfm Index: About.dfm =================================================================== RCS file: /home/cvs/exodus/exodus/About.dfm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- About.dfm 8 May 2002 23:07:33 -0000 1.5 +++ About.dfm 5 Sep 2002 13:18:45 -0000 1.6 @@ -32,6 +32,7 @@ Width = 332 Height = 128 Align = alClient + Center = True Picture.Data = { 07544269746D617036AA0000424D36AA00000000000036040000280000004A01 000080000000010008000000000000A60000130B0000130B0000000100000000 From reatmon at jabber.org Thu Sep 5 11:21:21 2002 From: reatmon at jabber.org (Ryan Eatmon) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: netjabber/Jabber Protocol.pm Message-ID: <20020905162121.2F35C63D39@hades.jabber.org> reatmon 02/09/05 11:21:21 Modified: Jabber Protocol.pm Log: fixed message callback Revision Changes Path 1.65 +2 -4 netjabber/Jabber/Protocol.pm Index: Protocol.pm =================================================================== RCS file: /home/cvs/netjabber/Jabber/Protocol.pm,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- Protocol.pm 5 Sep 2002 02:55:56 -0000 1.64 +++ Protocol.pm 5 Sep 2002 16:21:21 -0000 1.65 @@ -2401,7 +2401,6 @@ } - ############################################################################### # # LastActivity - returns number of seconds since the last activity. @@ -2416,7 +2415,6 @@ } - ############################################################################### # # RegisterRequest - This is a self contained function to send an iq tag @@ -2523,7 +2521,6 @@ } - ############################################################################### # # RegisterSendData - This is a self contained function to send a register iq @@ -3523,7 +3520,8 @@ my $sid = shift; my $message = shift; - my $type = $message->GetType(); + my $type = "normal"; + $type = $message->GetType() if $message->DefinedType(); if (exists($self->{CB}->{Mess}->{$type}) && (ref($self->{CB}->{Mess}->{$type}) eq "CODE")) From bobeal at jabber.org Thu Sep 5 14:07:05 2002 From: bobeal at jabber.org (Benoit Orihuela) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: xdb_sql - Imported sources Message-ID: <20020905190705.F366B63CFE@hades.jabber.org> bobeal 02/09/05 14:07:05 Log: Initial Import Status: Vendor Tag: xdb_sql Release Tags: REL-1_2 N xdb_sql/Announce N xdb_sql/AUTHORS N xdb_sql/ChangeLog N xdb_sql/BUGS N xdb_sql/COPYING N xdb_sql/FILES N xdb_sql/Makefile N xdb_sql/INSTALL N xdb_sql/jbox.xml N xdb_sql/README N xdb_sql/TODO N xdb_sql/database_documentation.txt N xdb_sql/sample_database.pg.sql N xdb_sql/sample_database.sql N xdb_sql/tests.txt N xdb_sql/xdb_sql.c N xdb_sql/xdb_sql.h N xdb_sql/xdb_sql.spec N xdb_sql/xdb_sql.xml N xdb_sql/xdb_sql_auth.c N xdb_sql/xdb_sql_auth0k.c N xdb_sql/xdb_sql_backend.c N xdb_sql/xdb_sql_backend.h N xdb_sql/xdb_sql_config.c N xdb_sql/xdb_sql_filter.c N xdb_sql/xdb_sql_generic.c N xdb_sql/xdb_sql_last.c N xdb_sql/xdb_sql_mysql.c N xdb_sql/xdb_sql_mysql.h N xdb_sql/xdb_sql_odbc.c N xdb_sql/xdb_sql_odbc.h N xdb_sql/xdb_sql_offline.c N xdb_sql/xdb_sql_pgsql.c N xdb_sql/xdb_sql_pgsql.h N xdb_sql/xdb_sql_querydef.c N xdb_sql/xdb_sql_register.c N xdb_sql/xdb_sql_roster.c N xdb_sql/xdb_sql_vcard.c No conflicts created by this import From bobeal at jabber.org Thu Sep 5 14:09:55 2002 From: bobeal at jabber.org (Benoit Orihuela) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: xdb_ldap - Imported sources Message-ID: <20020905190955.3A96A63CFE@hades.jabber.org> bobeal 02/09/05 14:09:55 Log: Initial Import Status: Vendor Tag: xdb_ldap Release Tags: REL-1_0 N xdb_ldap/ChangeLog N xdb_ldap/AUTHORS N xdb_ldap/BUGS N xdb_ldap/LISEZMOI N xdb_ldap/README N xdb_ldap/TODO N xdb_ldap/jabber-xdb.xml N xdb_ldap/jabber.schema N xdb_ldap/licence-JOSL.txt N xdb_ldap/slapd.conf N xdb_ldap/xdb_ldap.spec N xdb_ldap/docs/draft-ietf-ldapext-ldap-c-api-05.txt N xdb_ldap/docs/openldap_admin_guide.html N xdb_ldap/docs/rfc2256.txt N xdb_ldap/docs/rfc2798.txt N xdb_ldap/docs/rfc2829.txt N xdb_ldap/docs/vCard-XML-DTD-v2-20000321.txt N xdb_ldap/docs/vcard2ldap.txt N xdb_ldap/src/Makefile N xdb_ldap/src/xdb_ldap.c N xdb_ldap/src/xdb_ldap_auth.c N xdb_ldap/src/xdb_ldap_auth_0k.c N xdb_ldap/src/xdb_ldap_common.c N xdb_ldap/src/xdb_ldap_config.c N xdb_ldap/src/xdb_ldap_conn.c N xdb_ldap/src/xdb_ldap_jud.c N xdb_ldap/src/xdb_ldap_roster.c N xdb_ldap/src/xdb_ldap_vcard.c N xdb_ldap/include/xdb_ldap.h N xdb_ldap/scripts/add_jabberadmin.ldif N xdb_ldap/scripts/add_user.ldif N xdb_ldap/scripts/ldap_install.sh N xdb_ldap/scripts/organization.ldif N xdb_ldap/tests/Makefile N xdb_ldap/tests/ldap_client.c N xdb_ldap/tests/ldap_get_extended_ope.c N xdb_ldap/tests/ldap_print_dse.c N xdb_ldap/tests/ldap_sasl_bind.c N xdb_ldap/tests/ldap_sasl_bind_exemple.c N xdb_ldap/tests/trames_auth_vcard.txt No conflicts created by this import From linuxwolf at jabber.org Thu Sep 5 22:39:17 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jso/doc CHANGELOG Message-ID: <20020906033917.E95EC63CFE@hades.jabber.org> linuxwolf 02/09/05 22:39:17 Modified: doc Tag: RLS-0_2 CHANGELOG Log: 0.2 Release Revision Changes Path No revision No revision 1.3.2.3 +3 -0 jso/doc/CHANGELOG Index: CHANGELOG =================================================================== RCS file: /home/cvs/jso/doc/CHANGELOG,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -u -r1.3.2.2 -r1.3.2.3 --- CHANGELOG 4 Sep 2002 01:05:01 -0000 1.3.2.2 +++ CHANGELOG 6 Sep 2002 03:39:17 -0000 1.3.2.3 @@ -1,5 +1,8 @@ JSO Release Changes ----------------------------------------------------------- +0-2 (2002-09-05) +========== + - "Official" 0.2 Release 0.2-PRE3 (2002-09-03) ========== From linuxwolf at jabber.org Thu Sep 5 22:39:19 2002 From: linuxwolf at jabber.org (Matthew A. Miller) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jso/prj jso.ant-version.properties Message-ID: <20020906033919.2DCAE63CFE@hades.jabber.org> linuxwolf 02/09/05 22:39:19 Modified: prj Tag: RLS-0_2 jso.ant-version.properties Log: 0.2 Release Revision Changes Path No revision No revision 1.14.2.3 +1 -1 jso/prj/jso.ant-version.properties Index: jso.ant-version.properties =================================================================== RCS file: /home/cvs/jso/prj/jso.ant-version.properties,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -u -r1.14.2.2 -r1.14.2.3 --- jso.ant-version.properties 4 Sep 2002 01:05:03 -0000 1.14.2.2 +++ jso.ant-version.properties 6 Sep 2002 03:39:19 -0000 1.14.2.3 @@ -1,2 +1,2 @@ # Sample ResourceBundle properties file -project.version=0.2-PRE3 \ No newline at end of file +project.version=0.2 \ No newline at end of file From pgmillard at jabber.org Fri Sep 6 08:09:28 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus ChatWin.pas Debug.dfm Debug.pas JoinRoom.pas MsgQueue.pas Room.dfm Room.pas RosterWindow.pas invite.pas Message-ID: <20020906130928.270AB63D39@hades.jabber.org> pgmillard 02/09/06 08:09:28 Modified: exodus ChatWin.pas Debug.dfm Debug.pas JoinRoom.pas MsgQueue.pas Room.dfm Room.pas RosterWindow.pas invite.pas Log: Added subject handling in chats. Fixed room subject tooltips, and converted room subject to a unicode control. Better invalid ROOM jid message. Revision Changes Path 1.65 +9 -1 exodus/exodus/ChatWin.pas Index: ChatWin.pas =================================================================== RCS file: /home/cvs/exodus/exodus/ChatWin.pas,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- ChatWin.pas 4 Sep 2002 20:41:08 -0000 1.64 +++ ChatWin.pas 6 Sep 2002 13:09:27 -0000 1.65 @@ -407,7 +407,7 @@ {---------------------------------------} procedure TfrmChat.showMsg(tag: TXMLTag); var - Msg: TJabberMessage; + subj_msg, msg: TJabberMessage; begin // display the body of the msg if (timFlash.Enabled) then @@ -419,6 +419,14 @@ Msg.IsMe := false; // only display + notify if we have something to display :) + if (Msg.Subject <> '') then begin + subj_msg := TJabberMessage.Create(tag); + subj_msg.Body := 'The subject has been changed to: ' + subj_msg.Subject; + subj_msg.Subject := ''; + subj_msg.Nick := ''; + DisplayMsg(subj_msg, MsgList); + end; + if (Msg.Body <> '') then begin DoNotify(Self, 'notify_chatactivity', sChatActivity + OtherNick, ico_user); DisplayMsg(Msg, MsgList); 1.16 +1 -2 exodus/exodus/Debug.dfm Index: Debug.dfm =================================================================== RCS file: /home/cvs/exodus/exodus/Debug.dfm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- Debug.dfm 3 Sep 2002 05:11:30 -0000 1.15 +++ Debug.dfm 6 Sep 2002 13:09:27 -0000 1.16 @@ -143,13 +143,12 @@ LangOptions = [loAutoFont] Language = 1033 ParentFont = False - ReadOnly = True ScrollBars = ssVertical ShowSelectionBar = False TabOrder = 1 URLColor = clBlue URLCursor = crHandPoint - OnKeyDown = MsgDebugKeyDown + OnKeyPress = MsgDebugKeyPress InputFormat = ifUnicode OutputFormat = ofUnicode SelectedInOut = False 1.30 +3 -7 exodus/exodus/Debug.pas Index: Debug.pas =================================================================== RCS file: /home/cvs/exodus/exodus/Debug.pas,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- Debug.pas 3 Sep 2002 05:11:30 -0000 1.29 +++ Debug.pas 6 Sep 2002 13:09:27 -0000 1.30 @@ -62,8 +62,7 @@ procedure lblJIDClick(Sender: TObject); procedure Find1Click(Sender: TObject); procedure FindDialog1Find(Sender: TObject); - procedure MsgDebugKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); + procedure MsgDebugKeyPress(Sender: TObject; var Key: Char); private { Private declarations } _cb: integer; @@ -413,13 +412,10 @@ end; end; -procedure TfrmDebug.MsgDebugKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); +procedure TfrmDebug.MsgDebugKeyPress(Sender: TObject; var Key: Char); begin inherited; - memoSend.SetFocus(); - Beep(); - Key := 0; + Key := Chr(0); end; end. 1.4 +1 -1 exodus/exodus/JoinRoom.pas Index: JoinRoom.pas =================================================================== RCS file: /home/cvs/exodus/exodus/JoinRoom.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JoinRoom.pas 3 Sep 2002 05:01:24 -0000 1.3 +++ JoinRoom.pas 6 Sep 2002 13:09:27 -0000 1.4 @@ -95,7 +95,7 @@ // join this room rjid := txtRoom.Text + '@' + txtServer.Text; if (not isValidJid(rjid)) then begin - MessageDlg(sInvalidJID, mtError, [mbOK], 0); + MessageDlg(sInvalidRoomJID, mtError, [mbOK], 0); exit; end; 1.14 +1 -0 exodus/exodus/MsgQueue.pas Index: MsgQueue.pas =================================================================== RCS file: /home/cvs/exodus/exodus/MsgQueue.pas,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- MsgQueue.pas 2 Sep 2002 23:51:40 -0000 1.13 +++ MsgQueue.pas 6 Sep 2002 13:09:27 -0000 1.14 @@ -284,6 +284,7 @@ else if (lstEvents.SelCount = 1) then begin item := lstEvents.Selected; i := item.Index; + first := i; RemoveItem(i); end else begin 1.30 +23 -14 exodus/exodus/Room.dfm Index: Room.dfm =================================================================== RCS file: /home/cvs/exodus/exodus/Room.dfm,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- Room.dfm 2 Sep 2002 23:49:29 -0000 1.29 +++ Room.dfm 6 Sep 2002 13:09:27 -0000 1.30 @@ -9,19 +9,19 @@ TextHeight = 13 inherited Panel3: TPanel Top = 23 - Height = 232 + Height = 227 object Splitter2: TSplitter [0] Left = 270 Top = 4 Width = 3 - Height = 224 + Height = 219 Cursor = crHSplit Align = alRight ResizeStyle = rsUpdate end inherited MsgList: TExRichEdit Width = 266 - Height = 224 + Height = 219 PopupMenu = popRoom OnDragDrop = treeRosterDragDrop OnDragOver = treeRosterDragOver @@ -31,7 +31,7 @@ Left = 273 Top = 4 Width = 105 - Height = 224 + Height = 219 Align = alRight BevelOuter = bvNone BorderWidth = 1 @@ -41,7 +41,7 @@ Left = 1 Top = 1 Width = 103 - Height = 222 + Height = 217 Align = alClient Images = frmRosterWindow.ImageList1 Indent = 19 @@ -86,18 +86,10 @@ Align = alLeft BevelOuter = bvNone TabOrder = 0 - object lblSubject: TLabel - Left = 41 - Top = 2 - Width = 3 - Height = 13 - ParentShowHint = False - ShowHint = True - end object lblSubjectURL: TLabel Left = 0 Top = 0 - Width = 39 + Width = 41 Height = 21 Cursor = crHandPoint Align = alLeft @@ -109,6 +101,23 @@ Font.Style = [fsUnderline] ParentFont = False OnClick = lblSubjectURLClick + end + object lblSubject: TTntEdit + Left = 42 + Top = 0 + Width = 47 + Height = 17 + AutoSelect = False + BorderStyle = bsNone + Color = clBtnFace + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Arial' + Font.Style = [] + ParentFont = False + ReadOnly = True + TabOrder = 0 end end end 1.56 +11 -4 exodus/exodus/Room.pas Index: Room.pas =================================================================== RCS file: /home/cvs/exodus/exodus/Room.pas,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- Room.pas 3 Sep 2002 05:00:16 -0000 1.55 +++ Room.pas 6 Sep 2002 13:09:27 -0000 1.56 @@ -53,11 +53,11 @@ popRosterChat: TMenuItem; popRosterBlock: TMenuItem; pnlSubj: TPanel; - lblSubject: TLabel; lblSubjectURL: TLabel; btnClose: TSpeedButton; popClearHistory: TMenuItem; popShowHistory: TMenuItem; + lblSubject: TTntEdit; procedure FormCreate(Sender: TObject); procedure MsgOutKeyPress(Sender: TObject; var Key: Char); @@ -137,6 +137,8 @@ sBlocked = 'Blocked'; sBlock = 'Block'; sUnblock = 'UnBlock'; + sInvalidRoomJID = 'The Room Address you entered is invalid. It must be valid Jabber ID.'; + function StartRoom(rjid, rnick: Widestring): TfrmRoom; function IsRoom(rjid: Widestring): boolean; @@ -157,6 +159,7 @@ Presence, Roster, Session, + StrUtils, JabberID, MsgDisplay, Notify, @@ -227,6 +230,7 @@ tmp_jid: TJabberID; server: boolean; rm: TRoomMember; + tmps: string; begin // display the body of the msg Msg := TJabberMessage.Create(tag); @@ -269,8 +273,11 @@ end; if Msg.Subject <> '' then begin - lblSubject.Caption := ' ' + Msg.Subject; - lblSubject.Hint := Msg.Subject; + lblSubject.Text := ' ' + Msg.Subject; + tmps := Msg.Subject; + tmps := AnsiReplaceText(tmps, '|', Chr(13)); + tmps := AnsiReplaceText(tmps, '&', '&&'); + lblSubject.Hint := tmps; end; // this check is needed only to prevent extraneous regexing. @@ -734,7 +741,7 @@ s: string; begin // Change the subject - s := lblSubject.Caption; + s := lblSubject.Text; if InputQuery(sRoomSubjPrompt, sRoomNewSubj, s) then begin changeSubject(s); end; 1.76 +1 -0 exodus/exodus/RosterWindow.pas Index: RosterWindow.pas =================================================================== RCS file: /home/cvs/exodus/exodus/RosterWindow.pas,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- RosterWindow.pas 27 Aug 2002 05:19:05 -0000 1.75 +++ RosterWindow.pas 6 Sep 2002 13:09:27 -0000 1.76 @@ -1969,6 +1969,7 @@ Node: TTreeNode; var S: String); begin // user is done editing a node + getNodeType(Node); if (_cur_ritem <> nil) then begin _cur_ritem.Nickname := s; _cur_ritem.update(); 1.13 +1 -1 exodus/exodus/invite.pas Index: invite.pas =================================================================== RCS file: /home/cvs/exodus/exodus/invite.pas,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- invite.pas 30 Aug 2002 04:18:26 -0000 1.12 +++ invite.pas 6 Sep 2002 13:09:27 -0000 1.13 @@ -134,7 +134,7 @@ room := cboRoom.Text; if (not isValidJID(room)) then begin - MessageDlg('Invalid JID', mtError, [mbOK], 0); + MessageDlg(sInvalidRoomJID, mtError, [mbOK], 0); exit; end; From pgmillard at jabber.org Fri Sep 6 08:24:58 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus Jabber1.pas RosterRecv.dfm Message-ID: <20020906132458.2CF9F63D39@hades.jabber.org> pgmillard 02/09/06 08:24:58 Modified: exodus Jabber1.pas RosterRecv.dfm Log: Changed recv. roster items to have editable group drop down. Fixed up weird debug window behavior. Removed GetLastPopup madness Revision Changes Path 1.131 +1 -6 exodus/exodus/Jabber1.pas Index: Jabber1.pas =================================================================== RCS file: /home/cvs/exodus/exodus/Jabber1.pas,v retrieving revision 1.130 retrieving revision 1.131 diff -u -r1.130 -r1.131 --- Jabber1.pas 4 Sep 2002 20:41:08 -0000 1.130 +++ Jabber1.pas 6 Sep 2002 13:24:58 -0000 1.131 @@ -2671,13 +2671,8 @@ {---------------------------------------} procedure TfrmExodus.ApplicationEvents1Activate(Sender: TObject); -var - last: hwnd; begin - // if prefs or login are showing bring them to the top w/ SetWindowsPos - last := GetLastActivePopup(Application.Handle); - if (last <> Application.Handle) then - SetWindowPos(last, HWND_TOP, 0, 0, 0, 0, (SWP_NOSIZE or SWP_NOMOVE or SWP_SHOWWINDOW)); + // do something here maybe end; {---------------------------------------} 1.3 +0 -1 exodus/exodus/RosterRecv.dfm Index: RosterRecv.dfm =================================================================== RCS file: /home/cvs/exodus/exodus/RosterRecv.dfm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RosterRecv.dfm 27 Aug 2002 05:19:05 -0000 1.2 +++ RosterRecv.dfm 6 Sep 2002 13:24:58 -0000 1.3 @@ -226,7 +226,6 @@ Top = 3 Width = 209 Height = 21 - Style = csDropDownList Anchors = [akLeft, akTop, akRight] ItemHeight = 13 Sorted = True From pgmillard at jabber.org Fri Sep 6 10:18:32 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus RosterWindow.pas Message-ID: <20020906151832.A272863D39@hades.jabber.org> pgmillard 02/09/06 10:18:32 Modified: exodus RosterWindow.pas Log: Change to allow transports that have any s10n Revision Changes Path 1.77 +5 -0 exodus/exodus/RosterWindow.pas Index: RosterWindow.pas =================================================================== RCS file: /home/cvs/exodus/exodus/RosterWindow.pas,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- RosterWindow.pas 6 Sep 2002 13:09:27 -0000 1.76 +++ RosterWindow.pas 6 Sep 2002 15:18:32 -0000 1.77 @@ -822,6 +822,11 @@ exit; end + else if ((ritem.Groups.IndexOf('Transports') <> -1) and + (ritem.Groups.Count = 1) and (p <> nil)) then begin + // we have a transport... let them pass + end + else if ((ritem.subscription = 'none') or (ritem.subscription = '') or (ritem.subscription = 'from') or From pgmillard at jabber.org Fri Sep 6 10:18:33 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/exodus/web index.html Message-ID: <20020906151833.C81CC63D39@hades.jabber.org> pgmillard 02/09/06 10:18:33 Modified: exodus/web index.html Log: Change to allow transports that have any s10n Revision Changes Path 1.3 +7 -6 exodus/exodus/web/index.html Index: index.html =================================================================== RCS file: /home/cvs/exodus/exodus/web/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- index.html 25 Apr 2002 15:15:23 -0000 1.2 +++ index.html 6 Sep 2002 15:18:33 -0000 1.3 @@ -29,10 +29,11 @@
    - + - - + + +
    Downloads | Downloads | Screenshots | Bugs | Feature RequestsBugs | Feature Requests | CVS
    @@ -47,8 +48,8 @@
    Try out the client by -downloading it, -or visit the Sourceforge Project +downloading it, +or visit the Jabberstudio Project
    @@ -80,7 +81,7 @@ Copyright   Peter Millard, 2000 - 2002.
    -Jabber™ is a Trademark of Jabber, Inc. +Jabber™ is a Trademark of Jabber, Inc.
    From pgmillard at jabber.org Fri Sep 6 10:32:58 2002 From: pgmillard at jabber.org (Peter Millard) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: exodus/jopl Session.pas Message-ID: <20020906153258.4819763D39@hades.jabber.org> pgmillard 02/09/06 10:32:58 Modified: jopl Session.pas Log: Tweaked timeout period on auth request Revision Changes Path 1.41 +1 -1 exodus/jopl/Session.pas Index: Session.pas =================================================================== RCS file: /home/cvs/exodus/jopl/Session.pas,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Session.pas 4 Sep 2002 20:39:48 -0000 1.40 +++ Session.pas 6 Sep 2002 15:32:58 -0000 1.41 @@ -669,7 +669,7 @@ dig := qtag.GetFirstTag('digest'); // setup the iq-set - Auth := TJabberIQ.Create(Self, generateID, AuthCallback); + Auth := TJabberIQ.Create(Self, generateID, AuthCallback, 180); with Auth do begin Namespace := XMLNS_AUTH; iqType := 'set'; From stpeter at jabber.org Fri Sep 6 10:33:04 2002 From: stpeter at jabber.org (Peter Saint-Andre) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jeps/0045 - New directory Message-ID: <20020906153304.F3D5863D52@hades.jabber.org> stpeter 02/09/06 10:33:04 jeps/0045 - New directory From stpeter at jabber.org Fri Sep 6 18:08:47 2002 From: stpeter at jabber.org (Peter Saint-Andre) Date: Fri Jul 9 09:52:54 2004 Subject: [cvslog] cvs commit: jeps/0045 jep-0045.xml Message-ID: <20020906230847.4743F63D39@hades.jabber.org> stpeter 02/09/06 18:08:47 Added: 0045 jep-0045.xml Log: Initial version, still needs work before releasing. Revision Changes Path 1.1 jeps/0045/jep-0045.xml Index: jep-0045.xml ===================================================================
    Multi-User Chat A protocol for multi-user chat in Jabber. This document has been placed in the public domain. 0045 Experimental Standards Track Standards. Peter Saint-Andre stpeter@jabber.org stpeter@jabber.org 0.1 2002-09-06 psa Initial version.

    It has long been recognized that the Jabber community needs a new protocol for multi-user chat, or at least complete documentation of the protocol in use today. This JEP aims to provide a little bit of both, documenting the current protocol but showing how some simple extensions will enable Jabber systems to offer additional functionality of the kind that is often requested.

    In Jabber systems, multi-user chat environments are variously called chat rooms or conference rooms. Messages sent within these rooms are of a special type "groupchat". In addition, each room is identified as room-name@conferencing-service, where "conferencing-service" is the hostname at which the multi-user chat service is running. Each participant in a room is identified as room-name@conferencing-service/nickname, where "nickname" is the nickname of the participant as specified on joining the room (the nickname may or may not be the participant's actual username).

    This JEP documents a proposed standards-track protocol for text conferencing, organized by actor (Participant and Administrator) and then within each actor by use case.

    The main actor in a text conferencing system is the participant, who can be said to be located "in" a conference room and to participate in the discussions held in that room.

    In order to participate in multi-user discussions, a Jabber user must first enter a conference room. This is done by sending presence to the room, specifying the room name and also the user's desired nickname within the room:

    <presence to='coven@macbeth/thirdwitch'/>

    If the conferencing service is able to add the participant to the room, it will send presence from all the participants to the new participant's actual Jabber ID:

    <presence from='coven@macbeth/firstwitch' to='crone3@shakespeare/pda'/> <presence from='coven@macbeth/secondwitch' to='crone3@shakespeare/pda'/> <presence from='coven@macbeth/thirdwitch' to='crone3@shakespeare/pda'/>

    In order to leave a conference room, a participant sends presence of type unavailable to the room@service/nickname it has used in the room.

    <presence to='coven@macbeth/thirdwitch' type='unavailable'/>

    The conferencing service then sends presence of type unavailable to the departing participant's actual Jabber ID:

    <presence from='coven@macbeth/thirdwitch' to='crone3@shakespeare/pda' type='unavailable'/>

    A participant can send a message to all other participants in the room by sending a message of type "groupchat" to the room itself.

    <message to='coven@macbeth' type='groupchat'> <body>Thrice the brinded cat hath mew'd.</body> </message>

    The conferencing service is then responsible for reflecting that message out to the actual JID of each participant, with a type of "groupchat".

    <message from='coven@macbeth' to='crone1@shakespeare' type='groupchat'> <body>Thrice the brinded cat hath mew'd.</body> </message> <message from='coven@macbeth' to='crone2@shakespeare' type='groupchat'> <body>Thrice the brinded cat hath mew'd.</body> </message> <message from='coven@macbeth' to='crone3@shakespeare' type='groupchat'> <body>Thrice the brinded cat hath mew'd.</body> </message>

    Since each participant has a unique JID within the room, a participant may send a message to a selected participant by sending a message of a type other than "groupchat" to the participant's room-specific JID.

    <message to='coven@macbeth/firstwitch' type='chat'> <body>I'll give thee a wind.</body> </message>

    The conferencing service is responsible for adding the from address onto the message and delivering the message to the intended recipient's actual JID.

    <message from='coven@macbeth/secondwitch' to='crone1@shakespeare' type='chat'> <body>I'll give thee a wind.</body> </message>

    A common feature of multi-user chat rooms is the ability for a participant to change his or her nickname. In Jabber this is done by sending updated presence information to the room.

    <presence to='coven@macbeth/newnick'/>

    The conferencing service then sends two presence packets to the participant's actual JID, one of type unavailable for the old nickname and one indicating availability for the new nickname:

    <presence from='coven@macbeth/thirdwitch' to='crone3@shakespeare/pda' type='unavailable'/> <presence from='coven@macbeth/newnick' to='crone3@shakespeare/pda'/>

    It can be useful to invite another user to a room in which one is a participant. Several different mechanisms have been suggested in the past to do this. The protocol most commonly used is for the participant to send a message directly to the invitee, containing extended content in the jabber:x:conference namespace. The server adds a from address to the invite message, which is delivered like any other message. It is this protocol that is recommended in this JEP.

    <message to='hecate@shakespeare' type='normal'> <body>You have been invited to coven@macbeth.</body> <x jid='coven@macbeth' xmlns='jabber:x:conference'/> </message>

    The multi-user chat features most commonly requested in the Jabber community are almost always related to administration of rooms. The requests usually include a short list of features that are familiar from Internet Relay Chat, such as the ability to kick and ban users from a room, log discussion in a room, and toggle room attributes like room persistence and password protection. However, one sometimes also hears requests for additional features, such as invite-only rooms, encrypted rooms, and the ability to attach files to a room.

    It is not possible to imagine all the uses to which text conferencing rooms might be put, nor is it productive for the Jabber Software Foundation to create structured XML (e.g., request/response pairs using the <iq/> element) for every possible configuration option associated with a room. Therefore this JEP proposes the use of the jabber:x:data namespace For information about the jabber:x:data namepsace, refer to JEP-0004. for room configuration.

    In particular, this JEP recommends that when a user creates a room (in the current protocol, by sending presence to a room that does not yet exist), the conferencing service must send a message to the creator of the room containing a configuration form in the jabber:x:data namespace. The conferencing service must first create the room in accordance with some default set of attributes (e.g., a public room with no password and logging disabled). That way, if the conferencing service never receives the completed configuration form (e.g., because the user's client does not support the jabber:x:data namespace), the room will still be able to function with the default configuration.

    <presence to='coven@macbeth/firstwitch'/> <message from='macbeth' to='crone1@shakespeare'> <body>Your room "coven" has been created!</body> <x xmlns='jabber:x:data' type='form'> <title>Configuration for "coven" Room</title> <instructions>Complete this form to configure your room.</instructions> <field type='jid' label='Room Owner' var='owner'> <value>crone1@shakespeare</value> </field> <field type='boolean' label='Enable Logging?' var='logging'> <value>0</value> </field> <field type='boolean' label='Persistent Room?' var='persistence'> <value>0</value> </field> </x> </message>
    From shawn at jabber.org Fri Sep 6 23:24:21 2002 From: shawn at jabber.org (Shawn Wilton) Date: Fri Jul 9 09:52:55 2004 Subject: [cvslog] cvs commit: jabberbeans/src/org/jabber/jabberbeans ConnectionBean.java ConnectionEvent.java Message-ID: <20020907042421.01ACA63D39@hades.jabber.org> shawn 02/09/06 23:24:21 Modified: src/org/jabber/jabberbeans ConnectionBean.java ConnectionEvent.java Log: Revision Changes Path 1.3 +178 -203 jabberbeans/src/org/jabber/jabberbeans/ConnectionBean.java Index: ConnectionBean.java =================================================================== RCS file: /home/cvs/jabberbeans/src/org/jabber/jabberbeans/ConnectionBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ConnectionBean.java 26 Aug 2002 20:23:28 -0000 1.2 +++ ConnectionBean.java 7 Sep 2002 04:24:21 -0000 1.3 @@ -74,244 +74,217 @@ * @author David Waite * <dwaite@jabber.com> * @author $Author: shawn $ - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ -public class ConnectionBean - implements Serializable,PacketListenerRegistrar +public class ConnectionBean implements Serializable,PacketListenerRegistrar { - /** holds the current connection status. (e.g. connecting)*/ - private ConnectionEvent.EState status; + /** holds the current connection status. (e.g. connecting)*/ + private ConnectionEvent.EState status; - /** list of implementing interfaces which are listening for connection - * change events. */ - private final Vector connectionListeners = new Vector(); + /** list of implementing interfaces which are listening for connection + * change events. */ + private final Vector connectionListeners = new Vector(); - /** list of implementing interfaces which are listening for packet - * broadcast events. */ - private final Vector packetListeners = new Vector(); + /** list of implementing interfaces which are listening for packet + * broadcast events. */ + private final Vector packetListeners = new Vector(); - /** Socket, if one is used for the connection. */ - private Socket socket = null; + /** Socket, if one is used for the connection. */ + private Socket socket = null; - /** InputStream handling Thread. This class is responsible for parsing - * of external data (via a SAX-enabled parser), and also broadcasts - * received packet events. */ - private InputStreamHandler input = null; + /** InputStream handling Thread. This class is responsible for parsing + * of external data (via a SAX-enabled parser), and also broadcasts + * received packet events. */ + private InputStreamHandler input = null; - /** OutputStream handling Thread. This class is responsible for sending - * packets (providing a more asynchronous sending interface), and - * also broadcasts sent packet events. */ - private OutputStreamHandler output = null; + /** OutputStream handling Thread. This class is responsible for sending + * packets (providing a more asynchronous sending interface), and + * also broadcasts sent packet events. */ + private OutputStreamHandler output = null; - /** the default port for jabber servers, 5222 */ - public static final int DEFAULT_PORT = 5222; + /** the default port for jabber servers, 5222 */ + public static final int DEFAULT_PORT = 5222; - /** Default namespace for XMLStream */ - protected static final String DEFAULT_XMLSTREAM_NS = "jabber:client"; + /** Default namespace for XMLStream */ + protected static final String DEFAULT_XMLSTREAM_NS = "jabber:client"; - /** storage for SessionID */ - private String sessionID; + /** storage for SessionID */ + private String sessionID; - /** used to disable auto-sending XML stream tag */ - protected boolean DisableAutoHeader; +