From cvslog-admin at jabberstudio.org Thu May 1 12:43:38 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:02 2004 Subject: [cvslog] cvs commit: tkabber/tkabber avatars.tcl ChangeLog Message-ID: <20030501174338.6A67C63EAD@hades.jabber.org> aleksey 03/05/01 12:43:38 Modified: tkabber avatars.tcl ChangeLog Log: * avatars.tcl: Bugfix Revision Changes Path 1.10 +13 -11 tkabber/tkabber/avatars.tcl Index: avatars.tcl =================================================================== RCS file: /home/cvs/tkabber/tkabber/avatars.tcl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- avatars.tcl 26 Oct 2002 15:57:26 -0000 1.9 +++ avatars.tcl 1 May 2003 17:43:38 -0000 1.10 @@ -1,4 +1,4 @@ -# $Id: avatars.tcl,v 1.9 2002/10/26 15:57:26 alexey Exp $ +# $Id: avatars.tcl,v 1.10 2003/05/01 17:43:38 aleksey Exp $ namespace eval avatar { set options(announce) 0 @@ -98,12 +98,13 @@ return } - foreach child $children { - jlib::wrapper:splitxml $child tag vars isempty chdata childrens - if {$tag == "data"} { + jlib::wrapper:splitxml $children tag vars isempty chdata childrens + foreach child $childrens { + jlib::wrapper:splitxml $child tag1 vars1 isempty1 chdata1 childrens1 + if {$tag1 == "data"} { catch { - set avatar(data,$jid) [base64::decode $chdata] - avatar_$jid put $chdata + set avatar(data,$jid) [base64::decode $chdata1] + avatar_$jid put $chdata1 } } } @@ -117,12 +118,13 @@ return } - foreach child $children { - jlib::wrapper:splitxml $child tag vars isempty chdata childrens - if {$tag == "data"} { + jlib::wrapper:splitxml $children tag vars isempty chdata childrens + foreach child $childrens { + jlib::wrapper:splitxml $child tag1 vars1 isempty1 chdata1 childrens1 + if {$tag1 == "data"} { catch { - set avatar(data,$jid) [base64::decode $chdata] - avatar_$jid put $chdata + set avatar(data,$jid) [base64::decode $chdata1] + avatar_$jid put $chdata1 } } } 1.258 +4 -0 tkabber/tkabber/ChangeLog Index: ChangeLog =================================================================== RCS file: /home/cvs/tkabber/tkabber/ChangeLog,v retrieving revision 1.257 retrieving revision 1.258 diff -u -r1.257 -r1.258 --- ChangeLog 28 Apr 2003 13:58:33 -0000 1.257 +++ ChangeLog 1 May 2003 17:43:38 -0000 1.258 @@ -1,3 +1,7 @@ +2003-05-01 Alexey Shchepin + + * avatars.tcl: Bugfix + 2003-04-28 Alexey Shchepin * chats.tcl: Added recognizing of https:// in URL regexp From cvslog-admin at jabberstudio.org Thu May 1 12:46:55 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:02 2004 Subject: [cvslog] cvs commit: jeps/0022 jep-0022.xml Message-ID: <20030501174655.5B68163EAD@hades.jabber.org> stpeter 03/05/01 12:46:55 Modified: 0022 jep-0022.xml Log: Fixed a typo. Revision Changes Path 1.11 +1 -1 jeps/0022/jep-0022.xml Index: jep-0022.xml =================================================================== RCS file: /home/cvs/jeps/0022/jep-0022.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- jep-0022.xml 22 Apr 2003 03:50:52 -0000 1.10 +++ jep-0022.xml 1 May 2003 17:46:55 -0000 1.11 @@ -201,7 +201,7 @@ from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'> - + message22 From cvslog-admin at jabberstudio.org Thu May 1 17:56:55 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:02 2004 Subject: [cvslog] cvs commit: jeps/0060 jep-0060.xml Message-ID: <20030501225655.695F063D67@hades.jabber.org> pgmillard 03/05/01 17:56:55 Modified: 0060 jep-0060.xml Log: First pass at revision 0.9 Revision Changes Path 1.30 +59 -35 jeps/0060/jep-0060.xml Index: jep-0060.xml =================================================================== RCS file: /home/cvs/jeps/0060/jep-0060.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- jep-0060.xml 7 Apr 2003 17:09:05 -0000 1.29 +++ jep-0060.xml 1 May 2003 22:56:55 -0000 1.30 @@ -27,6 +27,13 @@ pgmillard@jabber.org + 0.9 + 2003-04-30 + pgm + Include JID attributes in the entity elements when receiving your affiliations. Changed error code 406 which was wrong to 404, which is correct. Added subscribe-options element for indicating subscriptions may be configured. + + + 0.8 2003-04-03 pgm @@ -236,6 +243,11 @@ + + + + +

The follow sections define the use cases and the protocol to be used by various actors in those use cases. The Implementation Notes section that follows describes many important factors and business rules which all pubsub systems must observe. (Note: the examples throughout assume the existence of a separate pubsub component and include any relevant 'from' addresses as stamped by a server or network edge.)

@@ -494,7 +506,7 @@

There may be commercial deployments which want to allow subscribers to be linked to some kind of paying customer database. In these cases, a subscription request may return a 402 (payment required) error, indicating that some pay-based service is associated with that pubsub node.

-

Entities MUST be allowed to query the system to provide all of the current affiliations for all nodes within that system for that entity. The affiliations element is used to make the request. For each affiliation, an entity element is returned containing the node identifier as well as the affiliation and the current subscription state.

+

Entities MUST be allowed to query the system to provide all of the current affiliations for all nodes within that system for that entity. The affiliations element is used to make the request. For each affiliation, an entity element is returned containing the node identifier, the jid which is affiliated (MAY include a resource, depending on how the subscribed subscribed) as well as the affiliation and the current subscription state.

To unsubscribe from a node, the subscriber sends an IQ request to the node in question. If the unsubscribe is successful, an IQ result is sent back. If the requestor is not an existing subscriber, the pubsub system MUST send back an IQ error using the 401 (Not Authorized) error code. If the node does not exist, the pubsub system MUST send back an IQ error using the 404 (Not Found) error code.

@@ -623,12 +635,12 @@ - - - - - - + + + + + + ]]> @@ -667,8 +679,11 @@

Implementations MAY allow subscribers to configure options for their own subscription. Implementations SHOULD use the Data Gathering and Reporting protocol to accomplish the configuration. Other non-supported configuration namespaces may be used (they MUST be properly namespaced) inside the <options> element.

-

If a node supports subscription options, it MUST send back an <options> element inside the result of the subscription request. The options element MAY contain a <required> child element if the subscriber MUST configure the subscription before receiving any notifications from that event. Systems MAY timeout subscription requests if configuration is required and a configuration request is not submitted within a reasonable amount of time. If the required element is not present, the subscription takes affect immediately and allows the entity to configure the subscription at any time.

+ +

If a node supports subscription options, it MUST send back an <options> element inside the entity element in the result of the subscription request. The options element MAY contain a <required> child element if the subscriber MUST configure the subscription before receiving any notifications from that event. Systems MAY timeout subscription requests if configuration is required and a configuration request is not submitted within a reasonable amount of time. If the required element is not present, the subscription takes affect immediately and allows the entity to configure the subscription at any time.

+

The following example shows SOME of the possible configuration options which MAY be implemented in some implementations. If an implementation implements these options using the Data Gathering and Reporting protocol, that implementation MUST use the field variables that are registered with the Jabber Registrar in association with the 'http://jabber.org/protocol/pubsub' namespace (a preliminary representation of those field variables is shown below, but must not be construed as canonical, since the Jabber Registrar MAY standardize additional fields at a later date without changes to this JEP). An implementation MAY choose to specify different labels, values, and even field types, but must conform to the defined variable naming scheme.

+

If nodes or systems do not support subscriber options, then the response for an options request MUST be a Not Implemented (501) error. If a subscriber attempts to set an invalid set of options, the system MUST respond with a Bad Request (400) error.

@@ -682,24 +697,26 @@ - - - - + + + + + ]]> - + + ]]> - + No subscriber options are available ]]> @@ -707,7 +724,7 @@ - + @@ -731,7 +748,7 @@ - + 0 - + 0 402Payment Required This error would typically be used to indicate that a subscription for a pubsub node is based on some kind payment system. Payments would be done out-of-band using some pre-agreed upon system. + - 405Not Allowed - An entity attempted to perform an action which the system does support, or the system administrator has not enabled. For example, the entity attempted to create a node but this deployment does not allow that. - - - 406Not Found + 404Not Found The node specified for some operation does not exist. + 405Not Allowed + An entity attempted to perform an action which the system does support, or the system administrator has not enabled. For example, the entity attempted to create a node but this deployment does not allow that. + + 407Registration Required Some implementations may require entities to register before node creation is allowed. @@ -1339,7 +1357,7 @@ -

Implementations of pubsub may wish to deliver event notifications only when the subscriber is online. In these cases, the option may be a node configuration option as shown in the examples above. +

Implementations of pubsub may wish to deliver event notifications only when the subscriber is online. In these cases, the option may be a node configuration option as shown in the examples above.

@@ -1354,6 +1372,12 @@

If item identifiers are used, they MUST be treated as unique within the scope of the node. Node-id + item-id MUST be unique within a given system, and MUST specify a single published item to a single node. Similar semantics for multiple publishes to the same item-id MAY have similar semantics to those stated above for nodes (with the exception of having multiple items in a list with the same item-id as item-ids MUST be unique within the scope of a node).

+ +

+ +

+
+

Implementations may handle sending subscription requests to node owners differently. Possibilities include:

@@ -1571,17 +1595,17 @@ @@ -1610,7 +1634,7 @@ @@ -1694,7 +1718,7 @@ - + @@ -1733,7 +1757,7 @@ - ]]> From cvslog-admin at jabberstudio.org Thu May 1 18:40:10 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:02 2004 Subject: [cvslog] cvs commit: ietf draft-ietf-xmpp-core-12.xml Message-ID: <20030501234010.71BAD63EB2@hades.jabber.org> stpeter 03/05/01 18:40:10 Modified: . draft-ietf-xmpp-core-12.xml Log: Interim changes. Revision Changes Path 1.2 +14 -13 ietf/draft-ietf-xmpp-core-12.xml Index: draft-ietf-xmpp-core-12.xml =================================================================== RCS file: /home/cvs/ietf/draft-ietf-xmpp-core-12.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- draft-ietf-xmpp-core-12.xml 28 Apr 2003 15:13:45 -0000 1.1 +++ draft-ietf-xmpp-core-12.xml 1 May 2003 23:40:10 -0000 1.2 @@ -1,7 +1,7 @@ - + XMPP Core @@ -19,7 +19,7 @@ http://www.jabber.org/people/jer.php - + Applications XMPP Jabber @@ -305,11 +305,11 @@
XMPP includes a method for securing the stream from tampering and eavesdropping. This channel encryption method makes use of the Transport Layer Security (TLS) protocol, along with a "STARTTLS" extension that is modelled on similar extensions for the IMAP, POP3, and ACAP protocols as described in RFC 2595. The namespace identifier for the STARTTLS extension is 'urn:ietf:params:xml:ns:xmpp-tls'. - TLS SHOULD be used between any initiating entity and any receiving entity (e.g., a stream from a client to a server or from one server to another). An administrator of a given domain MAY require use of TLS for either or both client-to-server communications and server-to-server communications. Servers SHOULD use TLS betweeen two domains for the purpose of securing server-to-server communcations. When the remote domain is already known, the server can verify the credentials of the known domain by comparing known keys or certificates. When the remote domain is not recognized, it may still be possible to verify a certificate if it is signed by a common trusted authority. Even if there is no way to verify certificates (e.g., an unknown domain with a self-signed certificate, or a certificate signed by an unrecognized authority), if the servers choose to communicate despite the lack of verified credentials, TLS still SHOULD be used to provide encryption. + TLS SHOULD be used between any initiating entity and any receiving entity (e.g., a stream from a client to a server or from one server to another). An administrator of a given domain MAY require use of TLS for either or both client-to-server communications and server-to-server communications. Servers SHOULD use TLS betweeen two domains for the purpose of securing server-to-server communications. When the remote domain is already known, the server can verify the credentials of the known domain by comparing known keys or certificates. When the remote domain is not recognized, it may still be possible to verify a certificate if it is signed by a common trusted authority. Even if there is no way to verify certificates (e.g., an unknown domain with a self-signed certificate, or a certificate signed by an unrecognized authority), if the servers choose to communicate despite the lack of verified credentials, TLS still SHOULD be used to provide channel encryption. The following business rules apply: An initiating entity that complies with this specification MUST include the "version='1.0'" flag in the initiating stream header. - When a receiving entity that complies with this specification receives an initiating stream header that includes the "version='1.0'" flag, after sending a stream header in reply it MUST also send a <starttls/> element scoped by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace as well as the list of other stream features it supports. + When a receiving entity that complies with this specification receives an initiating stream header that includes the "version='1.0'" flag, after sending a stream header in reply (including the version flag) it MUST also send a <starttls/> element scoped by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace as well as the list of other stream features it supports. If the initiating entity chooses to use TLS for stream encryption, TLS negotiation MUST be completed before proceeding to SASL negotiation. The initiating entity MUST validate the certificate presented by the receiving entity: @@ -331,9 +331,10 @@ The receiving entity responds by opening a TCP connection and sending an XML stream header to the initiating entity. The receiving entity offers the STARTTLS extension to the initiating entity by sending it along with the list of supported stream features. The initiating entity issues the STARTTLS command to instruct the receiving entity that it wishes to begin a TLS negotiation to secure the stream. - The receiving entity MUST reply with either a <proceed/> element or a <failure/> element scoped by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace, but keep the underlying TCP connection open. - The initiating entity begins a TLS negotiation in accordance with RFC 2246. Upon completion of the negotiation, the initiating entity initiates a new stream by sending a new opening XML stream header to the receiving entity. - The receiving entity responds by sending an XML stream header to the initiating entity along with the remaining available features (but NOT including the STARTTLS element). + The receiving entity MUST reply with either a <proceed/> element or a <failure/> element scoped by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace. If the failure case occurs, the receiving entity MUST terminate both the XML stream and the underlying TCP connection. If the proceed case occurs, the receiving entity MUST ignore any further XML data sent over the XML stream but keep the underlying TCP connection open for the purpose of completing the TLS negotiation. + The initiating entity and receiving entity attempt to complete a TLS negotiation in accordance with RFC 2246. + If the TLS negotiation is successful, the initiating entity SHOULD initiate a new stream by sending an opening XML stream header to the receiving entity. If the TLS negotiation is unsuccessful, the receiving entity MUST terminate the TCP connection. + Upon receiving the new stream header from the initiating entity, the receiving entity SHOULD respond by sending a new XML stream header to the initiating entity along with the remaining available features (but NOT including the STARTTLS element).
@@ -524,12 +525,12 @@ The following syntax rules apply: The initial challenge MUST include a realm, nonce, qop, charset, and algorithm. - The inital response for client-to-server negotiation MUST include a username, realm, nonce, cnonce, nc, qop, digest-uri, response, charset, and authzid. - The inital response for server-to-server negotiation MUST include a realm, nonce, cnonce, nc, qop, digest-uri, response, and charset. + The inital response for client-to-server negotiation MUST include all and only a username, realm, nonce, cnonce, nc, qop, digest-uri, response, charset, and authzid. + The inital response for server-to-server negotiation MUST include all and only a realm, nonce, cnonce, nc, qop, digest-uri, response, and charset. The realm-value MUST be no more than 1023 bytes in length and MUST conform to the nameprep profile of stringprep. The username-value MUST be no more than 1023 bytes in length and MUST conform to the nodeprep profile of stringprep. The response-value MUST be computed in accordance with the relevant SASL mechanism as defined by the appropriate RFC (e.g., RFC 2831 for digest authentication). - The resource identifier portion of the authzid-value MUST be no more than 1023 bytes in length and MUST conform to the resourceprep profile of stringprep. + The authzid-value MUST be a "full JID" of the form "user@domain/resource", where the "user" portion is a valid node identifier, the "domain" portion is a valid domain identifier, and the "resource" portion is a valid resource identifier as defined under Addressing Scheme.
@@ -1186,10 +1187,10 @@
The following rules apply to stanza-related errors: - A stanza of type "error" MUST contain an <error/> child element. + A stanza whose 'type' attribute has a value of "error" MUST contain an <error/> child element. The receiving or processing entity that returns an error to the sending entity SHOULD include the original XML sent along with the <error/> element and its children so that the sender can inspect and if necessary correct the XML before re-sending. - An entity that receives a message stanza of type 'error' MUST NOT respond to the stanza by sending a further message stanza of type 'error'; this helps to prevent looping. - An <error/> child MUST NOT be included if the stanza type is something other than "error". + An entity that receives a stanza whose 'type' attribute has a value of "error" MUST NOT respond to the stanza by responding with a stanza of type "error"; this helps to prevent looping. + An <error/> child MUST NOT be included if the 'type' attribute has a value other than "error".
From cvslog-admin at jabberstudio.org Thu May 1 20:46:08 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:02 2004 Subject: [cvslog] cvs commit: jeps/0050 jep-0050.xml Message-ID: <20030502014608.DDD1263EB2@hades.jabber.org> stpeter 03/05/01 20:46:08 Modified: 0050 jep-0050.xml Log: Fixed some typos, shortened the title. Revision Changes Path 1.27 +55 -55 jeps/0050/jep-0050.xml Index: jep-0050.xml =================================================================== RCS file: /home/cvs/jeps/0050/jep-0050.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- jep-0050.xml 28 Apr 2003 16:33:14 -0000 1.26 +++ jep-0050.xml 2 May 2003 01:46:08 -0000 1.27 @@ -6,8 +6,8 @@
- Reporting and Executing Ad-Hoc Commands - A proposal for reporting and executing ad-hoc, human-oriented commands in Jabber. + Ad-Hoc Commands + A protocol for reporting and executing ad-hoc, human-oriented commands in Jabber. &LEGALNOTICE; 0050 Experimental @@ -115,11 +115,11 @@

This mechanism allows for a larger base of Jabber users to participate as part of larger application architectures. Although specialized clients would be preferred in many environments, this protocol allows for applications to have a wider audience (i.e., any compliant Jabber client).

-

The namespace governing this protocol is "http://jabber.org/protocol/commands" (hereafter referred to as x-commands). This namespace relies on the &IQ; element for execution, and can use the &MESSAGE; element for announcing command lists. This protocol depends on &jep0030; for reporting and announcing command lists. This namespace is intended to complement &jep0004;, but is not necessarily dependent upon it.

+

The namespace governing this protocol is "http://jabber.org/protocol/commands" (hereafter referred to as x-commands). This namespace relies on the &IQ; element for execution, and can use the &MESSAGE; element for announcing command lists. This protocol depends on &jep0030; for reporting and announcing command lists. This namespace is intended to complement &jep0004; (jabber:x:data), but is not necessarily dependent upon it.

Support of x-commands implies support for "jabber:x:data" (although this requirement may be replaced and/or amended with a requirement to support &jep0020; by performing the appropriate negotations before executing commands). x-commands provides a bootstrap for performing ad-hoc "jabber:x:data" processes, while the data itself is conveyed using "jabber:x:data".

-

The x-commands namespace is not designed to replace machine-to-machine oriented RPC systems such as &jep0009;, where the two entities fully understand the command's purpose and behavior prior to execution. x-commands is oriented more for human interaction, where the user agent (such as a compliant Jabber client) most like has no prior knowledge of the command's purpose and behavior.

+

The x-commands namespace is not designed to replace machine-to-machine oriented RPC systems such as &jep0009;, where the two entities fully understand the command's purpose and behavior prior to execution. x-commands is oriented more for human interaction, where the user agent (such as a compliant Jabber client) most likely has no prior knowledge of the command's purpose and behavior.

@@ -153,7 +153,7 @@ from='requester@domain' to='responder@domain'> + node='http://jabber.org/protocol/commands'/> ]]> + node='http://jabber.org/protocol/commands'> + node='list' + name='List Service Configurations'/> + node='config' + name='Configure Service'/> + node='reset' + name='Reset Service Configuration'/> + node='start' + name='Start Service'/> + node='stop' + name='Stop Service'/> + node='restart' + name='Restart Service'/> ]]> -

The result can then be used by the client to populate a menu, or dialog of buttons, or whatever is appropriate to the current user interface. The responder is not required to send the same list of commands to all requesters.

+

The result can then be used by the client to populate a menu, a dialog of buttons, or whatever is appropriate to the current user interface. The responder is not required to send the same list of commands to all requesters.

If additional information about a command is desired, the requester queries for disco information on the command node:

+ node='config'/> ]]> + node='config'> + category='automation' + type='command'/> @@ -215,25 +215,25 @@ Service Controls + node='http://jabber.org/protocol/commands'> + node='list' + name='List Service Configurations'/> + node='config' + name='Configure Service'/> + node='reset' + name='Reset Service Configuration'/> + node='start' + name='Start Service'/> + node='stop' + name='Stop Service'/> + node='restart' + name='Restart Service'/> ]]> @@ -355,7 +355,7 @@ ]]> -

The execution of a command exists within the concept of a session. Each session is identified by the "sessionid" attribute, and SHOULD only be valid between one requester/responder pair. The responder is responsible for determining the session lifetime, with some help from the requester.

-

The requester starts a new session for a command by simply sending a <command/> with the "node" attribute (and optionally the "status" attribute with a value of "execute"). Once the "sessionid" attribute is given to the requester, it is the requester's responsibility to maintain it for the session's lifetime. A session ends when the responder sends a <command status='complete'/> or the requester sends a <command action='cancel'/> with the provided "sessionid".

-

Once a session has ended, its "session-id" value SHOULD NOT be used again. It is the responder's responsibility to ensure that each "sessionid" is unique.

+

The requester starts a new session for a command by simply sending a <command/> with the "node" attribute (and optionally the "status" attribute with a value of "execute"). Once the "sessionid" attribute is given to the requester, it is the requester's responsibility to maintain it for the session's lifetime. A session ends when the responder sends a <command status='completed'/> or the requester sends a <command action='cancel'/> with the provided "sessionid".

+

Once a session has ended, its "sessionid" value SHOULD NOT be used again. It is the responder's responsibility to ensure that each "sessionid" is unique.

It may be possible for a requester to be executing more than one session of the same command with a given responder. If the responder does not allow more than one session of the same command with the same requester, the responder MUST send an <iq type='error'/> with a "405" error code.

-

On its own, the <command/> has very little usefulness. It relies on its payload to give full meaning to its use. The payload can be elements in any namespace that makes sense and is understood (such as "jabber:x:data"), or one or more <note/> elements. Any namespaced elements can be used within a <commands/>. The only limitations are that the elements not require certain parent elements, or allows for <command/> in the "http://jabber.org/protocol/commands" namespace as a possible parent element.

-

As a general rule, the payload is only provided by the responder. The primary exception to this rule is with the "jabber:x:data" extension (and other namespaces with similar semantics). In this case, if the responder provides a form to submit, the requester SHOULD respond with a the submitted data (using the semantics from JEP-0004).

+

On its own, the <command/> has very little usefulness. It relies on its payload to give full meaning to its use. The payload can be elements in any namespace that makes sense and is understood (such as "jabber:x:data"), or one or more <note/> elements. Any namespaced elements can be used within a <command/>. The only limitations are that the elements not require certain parent elements, nor allow for <command/> in the "http://jabber.org/protocol/commands" namespace as a possible parent element.

+

As a general rule, the payload is provided only by the responder. The primary exception to this rule is with the "jabber:x:data" extension (and other namespaces with similar semantics). In this case, if the responder provides a form to submit, the requester SHOULD respond with the submitted data (using the semantics from JEP-0004).

When the precedence of these payload elements becomes important (such as when both "jabber:x:data" and "jabber:x:oob" elements are present), the order of the elements SHOULD be used. Those elements that come earlier in the child list take precedence over those later in the child list. To complement this, or provide an alternative, requester implementations can take precedence from the payload's namespace. For instance, "jabber:x:data" forms will generally take precedence over "jabber:x:oob" links. Finally, requester implementations that interface more directly with humans can attempt to process all received payload, and present a sensible interface.

@@ -415,19 +415,19 @@

A <command/> can specify the language/locale in use, by including the "xml:lang" attribute. Each execution session (identified by the "sessionid" attribute) SHOULD only use one language/locale, and requesters MAY assume the first language/locale specified applies. The responder SHOULD specify the language/locale with the first command session's response. Additionally, the requester MAY indicate the preferred language/locale by including the "xml:lang" attribute when starting execution:

- + ]]> - + Available Services @@ -488,7 +488,7 @@ @@ -515,7 +515,7 @@ - + The command should be canceled. -

The "xml:lang" attribute specifies the language/locale this <commang/> is intended for. This element MAY be specified by the requester to request a specific language/locale, and SHOULD be included by the responder to indicate the language/locale in use.

-

The children of a <command/> element (other than <note/>s) pertain to the command's execution. The order of these elements denote their precedence, so that those elements earlier in the list have higher precedence.

+

The "xml:lang" attribute specifies the language/locale this <command/> is intended for. This element MAY be specified by the requester to request a specific language/locale, and SHOULD be included by the responder to indicate the language/locale in use.

+

The children of a <command/> element (other than <note/>) pertain to the command's execution. The order of these elements denote their precedence, so that those elements earlier in the list have higher precedence.

Notes about the current status of commands are provided by <note/> elements. This element contains information about current conditions in a command sequence. This element has an attribute that defines the type of note. The body of a <note/> should contain a user-readable text message.

@@ -665,7 +665,7 @@

When reported commands, the requester SHOULD consider any command node that does not match the JID of the requester to be suspicious, and ignore those command nodes. Requesters MUST only report their own command nodes, and not the command nodes of other entities. This can help prevent limited cases of spoofing and "social engineering".

-

This JEP requires no interaction with the &IANA;.

+

This JEP requires no interaction with &IANA;.

From cvslog-admin at jabberstudio.org Thu May 1 22:35:57 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: jarl CHANGES Message-ID: <20030502033557.921AE63EBB@hades.jabber.org> reatmon 03/05/01 22:35:57 Modified: . CHANGES Log: Default Unfiled group in roster w/ config option to control it. Revision Changes Path 1.93 +3 -0 jarl/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/jarl/CHANGES,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- CHANGES 14 Jan 2003 12:37:20 -0000 1.92 +++ CHANGES 2 May 2003 03:35:57 -0000 1.93 @@ -1,5 +1,8 @@ 0.6000 ====== + - Added a default Unfiled group config and listing for the Roster. + If a user is not in a group, then they show up in a fake Unfiled + group so that the Roster is kept clean. - Tk: Multi-line presence status caused the Roster and status bar to behave badly. - Core: Fixed auto-away to not change if you set your presence. From cvslog-admin at jabberstudio.org Thu May 1 22:35:59 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: jarl/lib config_tk.pl main.pl settings.pl Message-ID: <20030502033559.593EB63EBB@hades.jabber.org> reatmon 03/05/01 22:35:59 Modified: lib config_tk.pl main.pl settings.pl Log: Default Unfiled group in roster w/ config option to control it. Revision Changes Path 1.17 +37 -0 jarl/lib/config_tk.pl Index: config_tk.pl =================================================================== RCS file: /home/cvs/jarl/lib/config_tk.pl,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- config_tk.pl 19 Sep 2002 04:04:18 -0000 1.16 +++ config_tk.pl 2 May 2003 03:35:59 -0000 1.17 @@ -731,6 +731,43 @@ bind("",sub{ $GUI{Config}->{Roster}->{RosterGroupCount}->{Check}->invoke(); }); + $GUI{Config}->{Roster}->{RosterUnfiledGroup}->{top} = + $GUI{Config}->{Roster}->{Left}->{top}-> + Frame(-background=>$GUI{color}->{bg}->{normal}, + -foreground=>$GUI{color}->{fg}->{dark} + )->pack(-side=>"top", + -fill=>"x", + -padx=>5); + $GUI{Config}->{Roster}->{RosterUnfiledGroup}->{Check} = + $GUI{Config}->{Roster}->{RosterUnfiledGroup}->{top}-> + Checkbutton(-background=>$GUI{color}->{bg}->{normal}, + -activebackground=>$GUI{color}->{bg}->{normal}, + -foreground=>$GUI{color}->{fg}->{dark}, + -selectcolor=>$GUI{color}->{bg}->{normal}, + -indicatoron=>0, + -borderwidth=>0, + -image=>$GUI{Icons}->{Unchecked}, + -selectimage=>$GUI{Icons}->{Checked}, + -variable=>$Profile->RosterUnfiledGroup("__POINTER__"), + -command=>sub{ + &jarlMain_UpdateRosterUnfiledGroup(); + } + )->pack(-side=>'left', + -anchor=>'e', + -padx=>0, + -pady=>0); + &jarlMainIF_RegisterIcon($GUI{Config}->{Roster}->{RosterUnfiledGroup}->{Check}, + ($Profile->RosterUnfiledGroup() ? "Checked" : "Unchecked")); + $GUI{Config}->{Roster}->{RosterUnfiledGroup}->{Label} = + $GUI{Config}->{Roster}->{RosterUnfiledGroup}->{top}-> + Label(-text=>"Place unfiled JIDs into an \"Unfiled\" group", + -background=>$GUI{color}->{bg}->{normal}, + -foreground=>$GUI{color}->{fg}->{dark}, + -font=>$GUI{fonts}->{normal}, + )->pack(-side=>'left', + -anchor=>'w'); + $GUI{Config}->{Roster}->{RosterUnfiledGroup}->{Label}-> + bind("",sub{ $GUI{Config}->{Roster}->{RosterUnfiledGroup}->{Check}->invoke(); }); 1.8 +12 -0 jarl/lib/main.pl Index: main.pl =================================================================== RCS file: /home/cvs/jarl/lib/main.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- main.pl 14 Jan 2003 12:37:22 -0000 1.7 +++ main.pl 2 May 2003 03:35:59 -0000 1.8 @@ -119,5 +119,17 @@ } +############################################################################## +# +# jarlMain_UpdateRosterUnfiledGroup - function call that sets whether or not +# group count is shown in the roster +# +############################################################################## +sub jarlMain_UpdateRosterUnfiledGroup +{ + $Roster->RosterUnfiledGroup($Profile->RosterUnfiledGroup()); +} + + 1; 1.21 +1 -0 jarl/lib/settings.pl Index: settings.pl =================================================================== RCS file: /home/cvs/jarl/lib/settings.pl,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- settings.pl 14 Jan 2003 12:37:22 -0000 1.20 +++ settings.pl 2 May 2003 03:35:59 -0000 1.21 @@ -149,6 +149,7 @@ &jarlMainIF_UpdateShowBrowser(); &jarlMain_UpdateRosterStatus(); &jarlMain_UpdateRosterGroupCount(); + &jarlMain_UpdateRosterUnfiledGroup(); } From cvslog-admin at jabberstudio.org Thu May 1 22:36:00 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: jarl/lib/Jarl Profile.pm Roster.pm Message-ID: <20030502033600.D97ED63EBB@hades.jabber.org> reatmon 03/05/01 22:36:00 Modified: lib/Jarl Profile.pm Roster.pm Log: Default Unfiled group in roster w/ config option to control it. Revision Changes Path 1.26 +4 -0 jarl/lib/Jarl/Profile.pm Index: Profile.pm =================================================================== RCS file: /home/cvs/jarl/lib/Jarl/Profile.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- Profile.pm 14 Jan 2003 12:37:23 -0000 1.25 +++ Profile.pm 2 May 2003 03:36:00 -0000 1.26 @@ -62,6 +62,7 @@ $self->{FUNCTIONS}->{GPGKeyServer} = 1; $self->{FUNCTIONS}->{RosterDoubleClick} = 1; $self->{FUNCTIONS}->{RosterGroupCount} = 1; + $self->{FUNCTIONS}->{RosterUnfiledGroup} = 1; $self->{FUNCTIONS}->{RosterStatus} = 1; $self->{FUNCTIONS}->{Subscriptions} = 1; $self->{FUNCTIONS}->{SubscriptionDeny} = 1; @@ -90,6 +91,7 @@ $self->{DEFAULTS}->{GPGKeyServer} = "certserver.pgp.com"; $self->{DEFAULTS}->{RosterDoubleClick} = "normal"; $self->{DEFAULTS}->{RosterGroupCount} = 0; + $self->{DEFAULTS}->{RosterUnfiledGroup} = 0; $self->{DEFAULTS}->{RosterStatus} = 0; $self->{DEFAULTS}->{Subscriptions} = "prompt"; $self->{DEFAULTS}->{SubscriptionDeny} = 0; @@ -286,6 +288,7 @@ $string .= "".&XML::Stream::EscapeXML($self->GPGKeyServer()).""; $string .= "".&XML::Stream::EscapeXML($self->RosterDoubleClick()).""; $string .= "".&XML::Stream::EscapeXML($self->RosterGroupCount()).""; + $string .= "".&XML::Stream::EscapeXML($self->RosterUnfiledGroup()).""; $string .= "".&XML::Stream::EscapeXML($self->RosterStatus()).""; $string .= "".&XML::Stream::EscapeXML($self->Subscriptions()).""; $string .= "".&XML::Stream::EscapeXML($self->SubscriptionDeny()).""; @@ -374,6 +377,7 @@ $self->RosterDoubleClick($tree->XPath('config/rosterdoubleclick/text()')); $self->RosterGroupCount($tree->XPath('config/rostergroupcount/text()')); + $self->RosterUnfiledGroup($tree->XPath('config/rosterunfiledgroup/text()')); $self->RosterStatus($tree->XPath('config/rosterstatus/text()')); $self->Subscriptions($tree->XPath('config/subscriptions/text()')); 1.22 +82 -44 jarl/lib/Jarl/Roster.pm Index: Roster.pm =================================================================== RCS file: /home/cvs/jarl/lib/Jarl/Roster.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Roster.pm 7 Sep 2002 22:59:18 -0000 1.21 +++ Roster.pm 2 May 2003 03:36:00 -0000 1.22 @@ -43,6 +43,7 @@ $self->{varsRosterStatus} = 0; $self->{varsGroupCount} = 0; + $self->{varsUnfiledGroup} = 0; return $self; } @@ -346,9 +347,19 @@ # GetGroups - returns an array of all of the groups in the roster. # ############################################################################## -sub GetGroups { - my $self = shift; - return grep { !/__roster__:none/; } sort( {lc($a) cmp lc($b)} keys(%{$self->{groups}})); +sub GetGroups +{ + my $self = shift; + if ($self->{varsUnfiledGroup} == 1) + { + my @list = grep { !/__roster__:none/; } sort( {lc($a) cmp lc($b)} keys(%{$self->{groups}})); + push(@list,'__roster__:none'); + return @list; + } + else + { + return grep { !/__roster__:none/; } sort( {lc($a) cmp lc($b)} keys(%{$self->{groups}})); + } } @@ -451,6 +462,26 @@ ############################################################################## # +# RosterUnfiledGroup - Sets the value of the roster status variable and draws +# the Roster. +# +############################################################################## +sub RosterUnfiledGroup +{ + my $self = shift; + my $value = shift; + + if (defined($value)) + { + $self->{varsUnfiledGroup} = $value; + $self->Draw(); + } + return $self->{varsUnfiledGroup}; +} + + +############################################################################## +# # CreateTag - generates a unique string that represents the entry in the # Roster based off of group, JID, and resource. # @@ -483,47 +514,53 @@ # that contains the Roster item. # ############################################################################## -sub AddJID { - my $self = shift; - my (%args) = @_; - - my $name = $args{-jid}; - $name = $args{-name} if (exists($args{-name}) && - defined($args{-name}) && - ($args{-name} ne "")); - - if (exists($self->{jids}->{$args{-jid}})) { - foreach my $group (keys(%{$self->{groups}})) { - delete($self->{groups}->{$group}->{$args{-jid}}) - if exists($self->{groups}->{$group}->{$args{-jid}}); - } - } - - $self->{jids}->{$args{-jid}}->{name} = $name; - $self->{jids}->{$args{-jid}}->{status} = 0; - $self->{jids}->{$args{-jid}}->{subscription} = $args{-subscription}; - $self->{jids}->{$args{-jid}}->{ask} = $args{-ask}; - $self->{jids}->{$args{-jid}}->{balloon} = "Offline"; - - $self->{case}->{lc($args{-jid})} = $args{-jid}; - - foreach my $group (@{$args{-groups}}) { - $self->AddGroup($group); - $self->{groups}->{$group}->{$args{-jid}} = 0; - $self->RegisterJID($group,$args{-jid}); - foreach my $resource (keys(%{$self->{resources}->{$args{-jid}}})) { - $self->RegisterJID($group,$args{-jid},$resource); - } - } - - my $res = $self->Resource($args{-jid}); +sub AddJID +{ + my $self = shift; + my (%args) = @_; - $self->{jids}->{$args{-jid}}->{balloon} = - $self->{resources}->{$args{-jid}}->{$res}->{balloon} - if defined($res); + my $name = $args{-jid}; + $name = $args{-name} + if (exists($args{-name}) && + defined($args{-name}) && + ($args{-name} ne "")); + + if (exists($self->{jids}->{$args{-jid}})) + { + foreach my $group (keys(%{$self->{groups}})) + { + delete($self->{groups}->{$group}->{$args{-jid}}) + if exists($self->{groups}->{$group}->{$args{-jid}}); + } + } + + $self->{jids}->{$args{-jid}}->{name} = $name; + $self->{jids}->{$args{-jid}}->{status} = 0; + $self->{jids}->{$args{-jid}}->{subscription} = $args{-subscription}; + $self->{jids}->{$args{-jid}}->{ask} = $args{-ask}; + $self->{jids}->{$args{-jid}}->{balloon} = "Offline"; + + $self->{case}->{lc($args{-jid})} = $args{-jid}; + + foreach my $group (@{$args{-groups}}) + { + $self->AddGroup($group); + $self->{groups}->{$group}->{$args{-jid}} = 0; + $self->RegisterJID($group,$args{-jid}); + foreach my $resource (keys(%{$self->{resources}->{$args{-jid}}})) + { + $self->RegisterJID($group,$args{-jid},$resource); + } + } + + my $res = $self->Resource($args{-jid}); + + $self->{jids}->{$args{-jid}}->{balloon} = + $self->{resources}->{$args{-jid}}->{$res}->{balloon} + if defined($res); - $self->GarbageCollect(); - $self->Draw(); + $self->GarbageCollect(); + $self->Draw(); } @@ -588,7 +625,8 @@ delete($self->{resources}->{$jid}) if (scalar(keys(%{$self->{resources}->{$jid}})) == 0); } - if ($self->{varsUpdateMode} eq "presence") { + if ($self->{varsUpdateMode} eq "presence") + { delete($self->{groups}->{'__roster__:none'}->{$jid}); delete($self->{jids}->{$jid}); } @@ -781,7 +819,7 @@ -ask=>$newRoster{$jid}->{ask}, (($#{$newRoster{$jid}->{groups}} > -1) ? (-groups=>$newRoster{$jid}->{groups}) : - (-groups=>['__roster__:none']) + (-groups=>['__roster__:none']) ) ); } From cvslog-admin at jabberstudio.org Thu May 1 22:36:03 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: jarl/lib/Tk Roster.pm Message-ID: <20030502033603.3D03963EBE@hades.jabber.org> reatmon 03/05/01 22:36:02 Modified: lib/Tk Roster.pm Log: Default Unfiled group in roster w/ config option to control it. Revision Changes Path 1.27 +206 -194 jarl/lib/Tk/Roster.pm Index: Roster.pm =================================================================== RCS file: /home/cvs/jarl/lib/Tk/Roster.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- Roster.pm 14 Jan 2003 12:37:25 -0000 1.26 +++ Roster.pm 2 May 2003 03:36:02 -0000 1.27 @@ -40,84 +40,86 @@ ############################################################################## sub Populate { -my ($self, $args) = @_; -my %args = %{$args}; + my ($self, $args) = @_; + my %args = %{$args}; -$self->{varsOnlineOnly} = 0; + $self->{varsOnlineOnly} = 0; -$self->{varsRosterBackground} = - $self->ParseArg($args,"-rosterbackground","white"); -$self->{varsGroupBackground} = - $self->ParseArg($args,"-groupbackground","grey65"); -$self->{varsGroupForeground} = - $self->ParseArg($args,"-groupforeground","white"); -$self->{varsJIDBackground} = - $self->ParseArg($args,"-jidbackground","grey75"); -$self->{varsJIDForeground} = - $self->ParseArg($args,"-jidforeground","black"); -$self->{varsSelectBackground} = - $self->ParseArg($args,"-selectbackground","lightblue"); -$self->{varsResourceBackground} = - $self->ParseArg($args,"-resourcebackground","grey85"); -$self->{varsResourceForeground} = - $self->ParseArg($args,"-resourceforeground","black"); -$self->{varsBalloon} = - $self->ParseArg($args,"-balloon",undef); -$self->{varsFont} = - $self->ParseArg($args,"-font",""); -$self->{varsJIDLeftCommand} = - $self->ParseArg($args,"-jidleftcommand",""); -$self->{varsJIDRightCommand} = - $self->ParseArg($args,"-jidrightcommand",""); -$self->{varsUpdateMode} = - $self->ParseArg($args,"-updatemode","roster"); -$self->{varsWidth} = - $self->ParseArg($args,"-width",200); - -$self->{frame} = - $self-> - Frame(%{$args})-> - pack(-side=>'top', - -padx=>0, - -pady=>0, - -fill=>'both', - -expand=>1); - -my $scrolled = - $self->{frame}-> - Scrolled("Canvas", - -scrollbars=>"osoe", - -height=>10, - -width=>$self->{varsWidth}, - -borderwidth=>0, - -relief=>"flat", - -background=>$self->{varsRosterBackground}, - -takefocus=>0, - -highlightthickness=>0 - )-> - pack(-side=>'top', - -fill=>'both', - -expand=>1, - -padx=>0, - -pady=>0); - -$self->{canvas} = $scrolled->Subwidget("canvas"); -$scrolled->Subwidget("yscrollbar")->configure(-width=>10, - -borderwidth=>1, - -relief=>"flat", - -takefocus=>0, - -highlightthickness=>0 - ); -$scrolled->Subwidget("xscrollbar")->configure(-width=>10, - -borderwidth=>1, - -relief=>"flat", - -takefocus=>0, - -highlightthickness=>0 - ); + $self->{varsRosterBackground} = + $self->ParseArg($args,"-rosterbackground","white"); + $self->{varsGroupBackground} = + $self->ParseArg($args,"-groupbackground","grey65"); + $self->{varsGroupForeground} = + $self->ParseArg($args,"-groupforeground","white"); + $self->{varsJIDBackground} = + $self->ParseArg($args,"-jidbackground","grey75"); + $self->{varsJIDForeground} = + $self->ParseArg($args,"-jidforeground","black"); + $self->{varsSelectBackground} = + $self->ParseArg($args,"-selectbackground","lightblue"); + $self->{varsResourceBackground} = + $self->ParseArg($args,"-resourcebackground","grey85"); + $self->{varsResourceForeground} = + $self->ParseArg($args,"-resourceforeground","black"); + $self->{varsBalloon} = + $self->ParseArg($args,"-balloon",undef); + $self->{varsFont} = + $self->ParseArg($args,"-font",""); + $self->{varsJIDLeftCommand} = + $self->ParseArg($args,"-jidleftcommand",""); + $self->{varsJIDRightCommand} = + $self->ParseArg($args,"-jidrightcommand",""); + $self->{varsUpdateMode} = + $self->ParseArg($args,"-updatemode","roster"); + $self->{varsWidth} = + $self->ParseArg($args,"-width",200); + + $self->{frame} = + $self-> + Frame(%{$args})-> + pack(-side=>'top', + -padx=>0, + -pady=>0, + -fill=>'both', + -expand=>1); + + my $scrolled = + $self->{frame}-> + Scrolled("Canvas", + -scrollbars=>"osoe", + -height=>10, + -width=>$self->{varsWidth}, + -borderwidth=>0, + -relief=>"flat", + -background=>$self->{varsRosterBackground}, + -takefocus=>0, + -highlightthickness=>0 + )-> + pack(-side=>'top', + -fill=>'both', + -expand=>1, + -padx=>0, + -pady=>0); + + $self->{canvas} = $scrolled->Subwidget("canvas"); + $scrolled->Subwidget("yscrollbar")->configure(-width=>10, + -borderwidth=>1, + -relief=>"flat", + -takefocus=>0, + -highlightthickness=>0 + ); + $scrolled->Subwidget("xscrollbar")->configure(-width=>10, + -borderwidth=>1, + -relief=>"flat", + -takefocus=>0, + -highlightthickness=>0 + ); -$self->{balloons} = {} if defined($self->{varsBalloon}); + $self->{balloons} = {} if defined($self->{varsBalloon}); -$self->DrawMode(1); + $self->DrawMode(1); + + $self->RegisterGroup("__roster__:none"); } @@ -129,9 +131,9 @@ ############################################################################## sub ParseArg { -my $self = shift; -my ($args,$arg,$default) = @_; -return (exists($args->{$arg}) ? delete($args->{$arg}) : $default); + my $self = shift; + my ($args,$arg,$default) = @_; + return (exists($args->{$arg}) ? delete($args->{$arg}) : $default); } @@ -142,102 +144,110 @@ ############################################################################## sub Draw { -my $self = shift; + my $self = shift; -return unless ($self->DrawMode() == 1); + return unless ($self->DrawMode() == 1); -$self->{canvas}->createText(-1000,-1000, - -text=>"TestString", - ( - (ref($self->{varsFont}) eq "Tk::Font") ? - (-font=>$self->{varsFont}) : - ( - ($self->{varsFont} ne "") ? - (-font=>$self->{varsFont}) : - () - ) - ), - -tags=>[ "rostertest" ]); + $self->{canvas}->createText(-1000,-1000, + -text=>"TestString", + ( + (ref($self->{varsFont}) eq "Tk::Font") ? + (-font=>$self->{varsFont}) : + ( + ($self->{varsFont} ne "") ? + (-font=>$self->{varsFont}) : + () + ) + ), + -tags=>[ "rostertest" ]); -my ($x1,$y1,$x2,$y2) = $self->{canvas}->bbox("rostertest"); + my ($x1,$y1,$x2,$y2) = $self->{canvas}->bbox("rostertest"); -$self->{varsItem}->{Height} = $y2 - $y1 + 4; -$self->{varsItem}->{Height} = 16 if ($self->{varsItem}->{Height} < 16); + $self->{varsItem}->{Height} = $y2 - $y1 + 4; + $self->{varsItem}->{Height} = 16 if ($self->{varsItem}->{Height} < 16); -$self->{canvas}->delete("all"); + $self->{canvas}->delete("all"); -$self->{varsY} = 0; + $self->{varsY} = 0; -foreach my $group ($self->GetGroups()) -{ - $self->DrawItem($self->CreateTag($group),"group",$group,0) - unless (($self->{varsOnlineOnly} == 1) && - ($self->ActiveGroup($group) == 0)); - - if ($self->{groups}->{$group}->{'__roster__:status'} == 1) + foreach my $group ($self->GetGroups()) { - foreach my $jid (sort {uc($self->{jids}->{$a}->{name}) cmp uc($self->{jids}->{$b}->{name})} keys(%{$self->{groups}->{$group}})) + my $drawGroup = $group; + $drawGroup = "Unfiled" if ($self->{varsUnfiledGroup} && ($group eq "__roster__:none")); + $self->DrawItem($self->CreateTag($group),"group",$drawGroup,0) + unless (($self->{varsOnlineOnly} == 1) && + ($self->ActiveGroup($group) == 0)); + + if ($self->{groups}->{$group}->{'__roster__:status'} == 1) { - next if ($jid eq '__roster__:status'); - next if (($self->{varsOnlineOnly} == 1) && !defined($self->Resource($jid))); - $self->DrawItem($self->CreateTag($group,$jid),"jid",$self->{jids}->{$jid}->{name},1); - if ($self->{groups}->{$group}->{$jid} == 1) + foreach my $jid (sort {uc($self->{jids}->{$a}->{name}) cmp uc($self->{jids}->{$b}->{name})} keys(%{$self->{groups}->{$group}})) { - foreach my $resource (sort {$self->{resources}->{$jid}->{$b}->{priority} <=> $self->{resources}->{$jid}->{$a}->{priority}} keys(%{$self->{resources}->{$jid}})) + next if ($jid eq '__roster__:status'); + next if (($self->{varsOnlineOnly} == 1) && !defined($self->Resource($jid))); + $self->DrawItem($self->CreateTag($group,$jid),"jid",$self->{jids}->{$jid}->{name},1); + if ($self->{groups}->{$group}->{$jid} == 1) { - $self->DrawItem($self->CreateTag($group,$jid,$resource),"resource",$resource,2); + foreach my $resource (sort {$self->{resources}->{$jid}->{$b}->{priority} <=> $self->{resources}->{$jid}->{$a}->{priority}} keys(%{$self->{resources}->{$jid}})) + { + $self->DrawItem($self->CreateTag($group,$jid,$resource),"resource",$resource,2); + } } } } } -} -foreach my $jid (sort {uc($self->{jids}->{$a}->{name}) cmp uc($self->{jids}->{$b}->{name})} keys(%{$self->{groups}->{'__roster__:none'}})) -{ - next if ($jid eq '__roster__:status'); - next if (($self->{varsOnlineOnly} == 1) && !defined($self->Resource($jid))); - $self->DrawItem($self->CreateTag('__roster__:none',$jid),"jid",$self->{jids}->{$jid}->{name},0); - if ($self->{groups}->{'__roster__:none'}->{$jid} == 1) + if ($self->{varsUnfiledGroup} == 0) { - foreach my $resource (sort {$self->{jids}->{$jid}->{resources}->{$b}->{priority} <=> $self->{resources}->{$jid}->{$a}->{priority}} keys(%{$self->{resources}->{$jid}})) + foreach my $jid (sort {uc($self->{jids}->{$a}->{name}) cmp uc($self->{jids}->{$b}->{name})} keys(%{$self->{groups}->{'__roster__:none'}})) { - $self->DrawItem($self->CreateTag('__roster__:none',$jid,$resource),"resource",$resource,1); + next if ($jid eq '__roster__:status'); + next if (($self->{varsOnlineOnly} == 1) && !defined($self->Resource($jid))); + $self->DrawItem($self->CreateTag('__roster__:none',$jid),"jid",$self->{jids}->{$jid}->{name},0); + if ($self->{groups}->{'__roster__:none'}->{$jid} == 1) + { + foreach my $resource (sort {$self->{jids}->{$jid}->{resources}->{$b}->{priority} <=> $self->{resources}->{$jid}->{$a}->{priority}} keys(%{$self->{resources}->{$jid}})) + { + $self->DrawItem($self->CreateTag('__roster__:none',$jid,$resource),"resource",$resource,1); + } + } } } -} -(undef,undef,undef,$y2) = $self->{canvas}->bbox("all"); -$y2 = 0 if !defined($y2); + (undef,undef,undef,$y2) = $self->{canvas}->bbox("all"); + $y2 = 0 if !defined($y2); -(undef,undef,$x2,undef) = $self->{canvas}->bbox("text"); -$x2 = 0 if !defined($x2); + (undef,undef,$x2,undef) = $self->{canvas}->bbox("text"); + $x2 = 0 if !defined($x2); -$x2 = 10 unless ($x2 > 10); -$y2 = 10 unless ($y2 > 10); + $x2 = 10 unless ($x2 > 10); + $y2 = 10 unless ($y2 > 10); -$self->{canvas}-> - configure(-scrollregion=> - [ 0, - 0, - ($x2+2), - $y2 - ]); - -$self->{varsBalloon}-> - attach($self->{canvas}, - -balloonposition => 'mouse', - -msg=>{ %{$self->{balloons}} }, - ) - if defined($self->{varsBalloon}); - -if (defined($self->{varsSelectedTag}) && - ($self->{canvas}->gettags($self->{varsSelectedTag}) ne "")) { - $self->{canvas}->itemconfigure($self->{varsSelectedTag}, - -fill=>$self->{varsSelectBackground}); -} else { - $self->{varsSelectedJID} = undef; - $self->{varsSelectedTag} = undef; -} + $self->{canvas}-> + configure(-scrollregion=> + [ 0, + 0, + ($x2+2), + $y2 + ]); + + $self->{varsBalloon}-> + attach($self->{canvas}, + -balloonposition => 'mouse', + -msg=>{ %{$self->{balloons}} }, + ) + if defined($self->{varsBalloon}); + + if (defined($self->{varsSelectedTag}) && + ($self->{canvas}->gettags($self->{varsSelectedTag}) ne "")) + { + $self->{canvas}->itemconfigure($self->{varsSelectedTag}, + -fill=>$self->{varsSelectBackground}); + } + else + { + $self->{varsSelectedJID} = undef; + $self->{varsSelectedTag} = undef; + } } @@ -258,20 +268,20 @@ $types{jid}->{fore} = $self->{varsJIDForeground}; $types{resource}->{back} = $self->{varsResourceBackground}; $types{resource}->{fore} = $self->{varsResourceForeground}; - + my ($group,$jid,$resource); - + foreach my $splitTag (split(':::',$tag)) { ($group) = ($splitTag =~ /^group-(.+)$/) if ($splitTag =~ /^group\-/); ($jid) = ($splitTag =~ /^jid-(.+)$/) if ($splitTag =~ /^jid\-/); ($resource) = ($splitTag =~ /^res-(.+)$/) if ($splitTag =~ /^res\-/); } - + $group = $self->UnescapeTag($group); $jid = $self->UnescapeTag($jid); $resource = $self->UnescapeTag($resource); - + my $icon; if ($type eq "group") @@ -294,7 +304,7 @@ if ($type eq "resource") { $icon = $main::GUI{Icons}->{Resource}; - + if ($self->{varsRosterStatus} == 1) { if (my $status = $self->{jids}->{$jid}->{balloon}) @@ -308,9 +318,9 @@ if ($type eq "jid") { my $resource = $self->Resource($jid); - + my $invisible = $self->GetValue($jid,"invisible") ? "1" : "0"; - + if (defined($resource)) { my $presence = @@ -319,7 +329,7 @@ $self->{resources}->{$jid}->{$resource}->{show} : $self->{resources}->{$jid}->{$resource}->{type} ); - + $icon = &main::jarlRosterIF_PresenceIcon($self, $presence, $jid); @@ -330,7 +340,7 @@ "unavailable", $jid); } - + if ($self->{varsRosterStatus} == 1) { if (my $status = $self->{jids}->{$jid}->{balloon}) @@ -340,7 +350,7 @@ } } } - + $self->{canvas}-> createRectangle(0, $self->{varsY}+1, @@ -362,29 +372,29 @@ () ) ]); - + $self->{canvas}->createImage(($indentLevel*15)+5, $self->{varsY}+(int($self->{varsItem}->{Height}/2)), -image=>$icon, -anchor=>"w", -tags=>[ $tag ]); - + $self->{canvas}->createText(($indentLevel*15)+($icon->width()+10), - $self->{varsY}+(int($self->{varsItem}->{Height}/2)), - -text=>$text, - ( - (ref($self->{varsFont}) eq "Tk::Font") ? - (-font=>$self->{varsFont}) : - ( - ($self->{varsFont} ne "") ? - (-font=>$self->{varsFont}) : - () - ) - ), - -fill=>$types{$type}->{fore}, - -anchor=>"w", - -tags=>[ $tag , "text" ]); - + $self->{varsY}+(int($self->{varsItem}->{Height}/2)), + -text=>$text, + ( + (ref($self->{varsFont}) eq "Tk::Font") ? + (-font=>$self->{varsFont}) : + ( + ($self->{varsFont} ne "") ? + (-font=>$self->{varsFont}) : + () + ) + ), + -fill=>$types{$type}->{fore}, + -anchor=>"w", + -tags=>[ $tag , "text" ]); + $self->{varsY} += $self->{varsItem}->{Height}; } @@ -400,27 +410,29 @@ my $self = shift; my ($group) = @_; - if (!defined($self->{canvas}->bind("group-${group}")) || - ($self->{canvas}->bind("group-${group}") eq "")) + my $tag = $self->CreateTag($group); + + if (!defined($self->{canvas}->bind($tag)) || + ($self->{canvas}->bind($tag) eq "")) { $self->{canvas}-> - bind("group-${group}", + bind($tag, "", sub { $self->{canvas}-> itemconfigure("jidback", - -fill=>$self->{varsJIDBackground}); + -fill=>$self->{varsJIDBackground}); $self->{canvas}-> itemconfigure("resback", - -fill=>$self->{varsResourceBackground}); + -fill=>$self->{varsResourceBackground}); $self->{varsSelectedJID} = undef; $self->{varsSelectedTag} = undef; - } - ); - + } + ); + $self->{canvas}-> - bind("group-${group}", + bind($tag, "", sub { @@ -447,7 +459,7 @@ $resource = "" unless defined($resource); my $tag = $self->CreateTag($group,$jid,$resource); - + if ($resource ne "") { $self->RegisterBalloon($tag,\$self->{resources}->{$jid}->{$resource}->{balloon}); @@ -462,7 +474,7 @@ my $fullJID = $jid; $fullJID .= "/${resource}" unless ($resource eq ""); - + $self->{canvas}-> bind($tag, "", @@ -470,13 +482,13 @@ { $self->{canvas}-> itemconfigure("jidback", - -fill=>$self->{varsJIDBackground}); + -fill=>$self->{varsJIDBackground}); $self->{canvas}-> itemconfigure("resback", - -fill=>$self->{varsResourceBackground}); + -fill=>$self->{varsResourceBackground}); $self->{canvas}-> itemconfigure("${tag}-back", - -fill=>$self->{varsSelectBackground}); + -fill=>$self->{varsSelectBackground}); $self->{varsSelectedJID} = $fullJID; $self->{varsSelectedTag} = "${tag}-back"; &{$self->{varsJIDRightCommand}}($group,$jid,$resource) @@ -491,13 +503,13 @@ { $self->{canvas}-> itemconfigure("jidback", - -fill=>$self->{varsJIDBackground}); + -fill=>$self->{varsJIDBackground}); $self->{canvas}-> itemconfigure("resback", - -fill=>$self->{varsResourceBackground}); + -fill=>$self->{varsResourceBackground}); $self->{canvas}-> itemconfigure("${tag}-back", - -fill=>$self->{varsSelectBackground}); + -fill=>$self->{varsSelectBackground}); $self->{varsSelectedJID} = $fullJID; $self->{varsSelectedTag} = "${tag}-back"; } @@ -523,7 +535,7 @@ sub Clear { my $self = shift; - + $self->{canvas}->delete("all"); $self->SUPER::Clear(); } From cvslog-admin at jabberstudio.org Fri May 2 05:42:58 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: GroupChatApplet/root - Imported sources Message-ID: <20030502104258.B9CB263EAB@hades.jabber.org> uls 03/05/02 05:42:58 Log: Created dir struc Status: Vendor Tag: GroupChatApplet Release Tags: start N GroupChatApplet/root/cvsinit.sh cvs: ERROR: cannot write file /home/cvs/GroupChatApplet/root/cvsinit.sh,v: No such file or directory No conflicts created by this import From cvslog-admin at jabberstudio.org Fri May 2 05:44:21 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: groupchatapplet/root - Imported sources Message-ID: <20030502104421.8200563EAB@hades.jabber.org> uls 03/05/02 05:44:21 Log: Created dir struc Status: Vendor Tag: GroupChatApplet Release Tags: start N groupchatapplet/root/cvsinit.sh No conflicts created by this import From cvslog-admin at jabberstudio.org Fri May 2 06:18:32 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: j-xmpp/root - Imported sources Message-ID: <20030502111832.69FEA63EAB@hades.jabber.org> uls 03/05/02 06:18:32 Log: Created dir struc Status: Vendor Tag: j-xmpp Release Tags: start N j-xmpp/root/readme No conflicts created by this import From cvslog-admin at jabberstudio.org Fri May 2 06:51:34 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: j-xmpp/root/sources - New directory Message-ID: <20030502115134.2471F63EAB@hades.jabber.org> uls 03/05/02 06:51:34 j-xmpp/root/sources - New directory From cvslog-admin at jabberstudio.org Fri May 2 06:53:21 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: j-xmpp/root/sources BasicConnector.java Element.java PHashtable.java SimpleUI.java Starter.java TagListener.java Vector.java XMLTagParser.java XMPPConnector.java Message-ID: <20030502115321.64FEB63EAB@hades.jabber.org> uls 03/05/02 06:53:21 Added: root/sources BasicConnector.java Element.java PHashtable.java SimpleUI.java Starter.java TagListener.java Vector.java XMLTagParser.java XMPPConnector.java Log: start Revision Changes Path 1.1 j-xmpp/root/sources/BasicConnector.java Index: BasicConnector.java =================================================================== class BasicXMPPConnector{ } 1.1 j-xmpp/root/sources/Element.java Index: Element.java =================================================================== import java.util.Hashtable; public class Element{ public PHashtable attributes; public Vector elements; public String text=""; public String name=""; public boolean closed=false; public Element parent=null; Element(){ attributes=new PHashtable(); elements=new Vector(); } public boolean isEmpty(){ if(elements.isEmpty())return true; return false; } Element(String name){ this.name=name; attributes=new PHashtable(); elements=new Vector(); } public void addAttr(String name, String value){ attributes.put(name, value); } public String getAttr(String name){ return (String)attributes.get(name); } public void setText(String t){ text=t; } public String getText(){ return text; } public void addElement(Element e){ elements.addElement(e); } public Element getElement(String n){ for(int i=0;i"; return str; } } 1.1 j-xmpp/root/sources/PHashtable.java Index: PHashtable.java =================================================================== public class PHashtable{ Object[] key; Object[] value; PHashtable(){ key=new Object[0]; value=new Object[0]; } public boolean contains(Object k){ for(int i=0;itestd "; XMLTagParser x=new XMLTagParser(); for(int i=0;i")){ tagStart(); state=S8; } else if(c.equals("/")){ state=S10; } else{ if(c.equals(" ")){ state=S2; attributename=""; } else{ tagname+=c; } } } public void state2(String c){ if(c.equals("?"))state=S1; if(c.equals("=")){ state=S3; } else{ if(!(c.equals(" ")))attributename+=c; } } public void state3(String c){ if(c.equals("\"")|c.equals("'")){ state=S4; attributevalue=""; } } public void state4(String c){ if(c.equals("?")){ state=S5; } else if(c.equals("\"")|c.equals("'")){ state=S5; attributes.put(attributename, attributevalue); } else{ state=S4; attributevalue+=c; } } public void state5(String c){ if(c.equals("?")){ state=S5; } else if(c.equals(">")){ state=S8; tagStart(); } else if(c.equals(" ")){ state=S5; } else if(c.equals("/")){ state=S10; } else{ state=S2; attributename=c; } } public void state6(String c){ } public void state7(String c){ } public void state8(String c){ if(c.equals("<")){ state=S9; } else{ state=S8; //add to cdata text cdata+=c; } } public void state9(String c){ if(c.equals("/")){ state=S10; } else{ child=new XMLTagParser(this); child.taglisteners=taglisteners; child.setLevel(level+1); //child.addChar((new String("<")).charAt(0)); //child.addChar(c.charAt(0)); child.state=10; child.tagname+=c; state=S8; } } public void state10(String c){ if(c.equals(">")){ state=S11; //tag finished element.name=tagname; element.text=cdata; element.attributes=attributes; if(parent!=null){ parent.child=null; parent.element.addElement(element); } System.out.print("\nEnd of tag detected-> "); System.out.print(element.toString()); tagStop(); } else{ state=S10; } } public void state11(String c){ } public void tagStart(){ element.name=tagname; element.attributes=attributes; Element e=element; System.out.println("\nTAG started:"+e.name+"/"+e.toString()); for(int i=0;i"); //close the 'real' socket s.close(); } catch(Exception e){ e.printStackTrace(); } p.disconnected(); } public void sendSimpleMessage(String to, String body){ rawSend(""+body+""); } public void run(){ //this is the main starter routine, this routine starts the Thread. try{ connect(); while(true){ //here we read char wise from our input stream ... char c=(char)s.getInputStream().read(); //... and hand it manually to our xml tag parser xmltp.addChar(c); } } catch(Exception e){ disconnect(); stop(); } } /* * rawSend sends a string directly to our outbound stream */ public void rawSend(String s){ try{ //just to stay sure, i send a new line afterwards. bw.write(s+"\n"); //emptying the outbound stream. bw.flush(); } catch(Exception e){ //of course in case of exceptions, we print our exception to System.err as always e.printStackTrace(); } } /* * startStream sends stream descriptors to our server */ public void startStream(){ try{ //send the xml version String s=""; rawSend(s); //send the stream starter s=""; rawSend(s); } catch(Exception e){ e.printStackTrace(); } } /* * tagStop(): Tag listener function, get called from xml tag parser whenever a tag ends */ public void tagStop(Element e){ p.display("TAG: "+e.toString()); switch(state){ //reaction depends on our position in the state engine case QUERIEDAUTH: if(e.name.equals("iq")){ parseAuthRequestReply(e); } break; case SENTLOGINDATA: p.display("login data sent"); if(e.name.equals("iq")){ if(e.isEmpty()){ p.connected(); state=LOGGEDIN; sendPresence(); } else{ //here is space for negative authentication handling } } break; case LOGGEDIN: //if we are logged in and stuff, we handle the element in our handle function handle(e); break; } } /* * tagStart() gets called whenever a tag starts */ public void tagStart(Element e){ // switch(state){ case INITSTATE: //components recieve xml tags, but don`t send them. if(e.name.equals("?xml")){ xmltp=new XMLTagParser(); xmltp.attach(this); } if(e.name.equals("stream:stream")){ //this is definitely a stream start. if(e.attributes.contains("xmlns:sasl")){ //yes, the stream supports SASL state=SASL; } else{ //no it doesn't state=NOTSASL; } //now we have to extract the stream id streamid=(String)e.attributes.get("id"); //we have the state set, but what to do next? simple go into this routine once again. tagStart(e); xmltp=new XMLTagParser(); xmltp.attach(this); } break; case SASL: //if this is a SASL enabled server we have connected to. if(e.name.equals("sasl:mechanisms")){ //we would do something here } break; case NOTSASL: //now we query for authentication requirements state=QUERIEDAUTH; queryAuth(); break; case QUERIEDAUTH: //we recieved a response to our authenitication insult if(e.name.equals("iq")){ parseAuthRequestReply(e); } break; } } /* * loginwith... loggs in with Plain password, ever wondered why functions have names? */ public void loginWithPlainPassword(){ //now we login with a plain password. sorry, no need for digest and stuff String s=""; s+=""+username+""; s+=""+resource+""; s+=""+password+""; s+="\n"; rawSend(s); } /* * if we recieve an auth request reply, it gets handed to this function. man, functions have names! */ public void parseAuthRequestReply(Element e){ //now we parse it if(((String)(e.attributes.get("type"))).equals("result")){ Element q=e.getElement("query"); if(q!=null){ Element p=q.getElement("password"); if(p!=null){ state=SENTLOGINDATA; loginWithPlainPassword(); } } } else if(((String)(e.attributes.get("type"))).equals("error")){ Element error=e.getElement("error"); if(error!=null){ //we really should print the error text ( error.getText() ) } } } /* * see name of function. */ public void queryAuth(){ String s=""; s+=""+username+"\n"; rawSend(s); } /* * handle(): whenever we receieve an element when connected, we handle it in here. */ public void handle(Element e){ try{ if(e.name.equals("message")){ String type=e.getAttr("type"); String from=e.getAttr("from"); Element thread=e.getElement("thread"); Element body=e.getElement("body"); Element subject=e.getElement("subject"); Element x=e.getElement("x"); if(type==null)type=""; if(thread==null)thread=new Element(); if(body==null)body=new Element(); if(subject==null)subject=new Element(); if(x==null)x=new Element(); p.messageArrived(from, type, thread.getText(), subject.getText(), body.getText(), x.toString()); } if(e.name.equals("iq")){ String id=e.getAttr("id"); String type=e.getAttr("type"); String from=e.getAttr("from"); if(type.equals("get")){ if(e.getElement("query")!=null){ String namespace=e.getElement("query").getAttr("xmlns"); if(namespace.equals("jabber:iq:version")){ String s=""; s+="XMPP Connector - ulrich staudinger"; s+="2.4"; s+="java 1.1"; rawSend(s); } } } if(((String)(e.attributes.get("type"))).equals("error")){ //this one occurs whenever we recieve an error through iq Element error=e.getElement("error"); if(error!=null){ //we really should print the error text somewhere. System.err.println(error.toString()); } } //now code for general iq handling if(id==null)id=""; if(type==null)type=""; if(from==null)from=""; String namespace=""; Element query=e.getElement("query"); if(query!=null){ namespace=e.getElement("query").getAttr("xmlns"); } else{ query=new Element(); } //now we hand it to the UI p.iqArrived(from, type, id, namespace, query); } if(e.name.equals("presence")){ /* presence handling disabled atm. Element show=e.getElement("show"); if(show==null){ Contact c=p.getContact(e.getAttr("from")); String t=e.getAttr("type"); if(t!=null){ if(t.equals("unavailable")){ if(p.getChannelFor(e.getAttr("from"))!=null){ p.getChannelFor(e.getAttr("from")).displayStatus(c); } p.removeContact(c); } if(t.equals("subscribe")){ p.displaySubReq(e); } } c.show="online"; } else{ Contact c=p.getContact(e.getAttr("from")); c.show=show.getText(); if(p.getChannelFor(e.getAttr("from"))!=null){ p.getChannelFor(e.getAttr("from")).displayStatus(c); } } p.getRoster().rebuildRoster(); */ } } catch(Exception exc){ //Somewhere happened an exception during element handling exc.printStackTrace(); } } void disconnected(){ //gets called from pinger thread whenever an error occurs. p.disconnected(); } public void sendPresence(){ String s=""; s+=""; rawSend(s); } } class Pinger extends Thread{ public XMPPConnector xc; Pinger(XMPPConnector xc){ this.xc=xc; } public void run(){ while(true){ try{ sleep(25000); xc.rawSend("\n"); }catch(Exception e){ //propably connection interrupted e.printStackTrace(); //call disconnect function xc.disconnected(); stop(); } } } } From cvslog-admin at jabberstudio.org Fri May 2 06:54:41 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:03 2004 Subject: [cvslog] cvs commit: groupchatapplet/root/sources - New directory Message-ID: <20030502115441.E07E163EAB@hades.jabber.org> uls 03/05/02 06:54:41 groupchatapplet/root/sources - New directory From cvslog-admin at jabberstudio.org Fri May 2 06:55:12 2003 From: cvslog-admin at jabberstudio.org (cvslog-admin@jabberstudio.org) Date: Fri Jul 9 10:03:04 2004 Subject: [cvslog] cvs commit: groupchatapplet/root/sources BasicConnector.java Element.java PHashtable.java SimpleUI.java Starter.java TagListener.java Vector.java XMLTagParser.java XMPPConnector.java Message-ID: <20030502115512.4BEA863EAB@hades.jabber.org> uls 03/05/02 06:55:12 Added: root/sources BasicConnector.java Element.java PHashtable.java SimpleUI.java Starter.java TagListener.java Vector.java XMLTagParser.java XMPPConnector.java Log: Revision Changes Path 1.1 groupchatapplet/root/sources/BasicConnector.java Index: BasicConnector.java =================================================================== class BasicXMPPConnector{ } 1.1 groupchatapplet/root/sources/Element.java Index: Element.java =================================================================== import java.util.Hashtable; public class Element{ public PHashtable attributes; public Vector elements; public String text=""; public String name=""; public boolean closed=false; public Element parent=null; Element(){ attributes=new PHashtable(); elements=new Vector(); } public boolean isEmpty(){ if(elements.isEmpty())return true; return false; } Element(String name){ this.name=name; attributes=new PHashtable(); elements=new Vector(); } public void addAttr(String name, String value){ attributes.put(name, value); } public String getAttr(String name){ return (String)attributes.get(name); } public void setText(String t){ text=t; } public String getText(){ return text; } public void addElement(Element e){ elements.addElement(e); } public Element getElement(String n){ for(int i=0;i"; return str; } } 1.1 groupchatapplet/root/sources/PHashtable.java Index: PHashtable.java =================================================================== public class PHashtable{ Object[] key; Object[] value; PHashtable(){ key=new Object[0]; value=new Object[0]; } public boolean contains(Object k){ for(int i=0;itestd "; XMLTagParser x=new XMLTagParser(); for(int i=0;i")){ tagStart(); state=S8; } else if(c.equals("/")){ state=S10; } else{ if(c.equals(" ")){ state=S2; attributename=""; } else{ tagname+=c; } } } public void state2(String c){ if(c.equals("?"))state=S1; if(c.equals("=")){ state=S3; } else{ if(!(c.equals(" ")))attributename+=c; } } public void state3(String c){ if(c.equals("\"")|c.equals("'")){ state=S4; attributevalue=""; } } public void state4(String c){ if(c.equals("?")){ state=S5; } else if(c.equals("\"")|c.equals("'")){ state=S5; attributes.put(attributename, attributevalue); } else{ state=S4; attributevalue+=c; } } public void state5(String c){ if(c.equals("?")){ state=S5; } else if(c.equals(">")){ state=S8; tagStart(); } else if(c.equals(" ")){ state=S5; } else if(c.equals("/")){ state=S10; } else{ state=S2; attributename=c; } } public void state6(String c){ } public void state7(String c){ } public void state8(String c){ if(c.equals("<")){ state=S9; } else{ state=S8; //add to cdata text cdata+=c; } } public void state9(String c){ if(c.equals("/")){ state=S10; } else{ child=new XMLTagParser(this); child.taglisteners=taglisteners; child.setLevel(level+1); //child.addChar((new String("<")).charAt(0)); //child.addChar(c.charAt(0)); child.state=10; child.tagname+=c; state=S8; } } public void state10(String c){ if(c.equals(">")){ state=S11; //tag finished element.name=tagname; element.text=cdata; element.attributes=attributes; if(parent!=null){ parent.child=null; parent.element.addElement(element); } System.out.print("\nEnd of tag detected-> "); System.out.print(element.toString()); tagStop(); } else{ state=S10; } } public void state11(String c){ } public void tagStart(){ element.name=tagname; element.attributes=attributes; Element e=element; System.out.println("\nTAG started:"+e.name+"/"+e.toString()); for(int i=0;i