diff options
author | Dr Scofield | 2008-06-04 13:06:24 +0000 |
---|---|---|
committer | Dr Scofield | 2008-06-04 13:06:24 +0000 |
commit | 67dee6410dcb982b899ec0bb9644d5afa4a8e2d1 (patch) | |
tree | 1bad930de9ec6088b6ce8695c028668f54a6ac4d /OpenSim/Framework/Communications/XMPP/Stanza.cs | |
parent | applied patch from mantis #1268 , thanks mikem (diff) | |
download | opensim-SC_OLD-67dee6410dcb982b899ec0bb9644d5afa4a8e2d1.zip opensim-SC_OLD-67dee6410dcb982b899ec0bb9644d5afa4a8e2d1.tar.gz opensim-SC_OLD-67dee6410dcb982b899ec0bb9644d5afa4a8e2d1.tar.bz2 opensim-SC_OLD-67dee6410dcb982b899ec0bb9644d5afa4a8e2d1.tar.xz |
* fleshing out XMPP entities, adding XmppWriter and XmppSerializer
having spent the last couple of days wrestling with .NET XmlSerializer
and trying to get it to do what is required by XMPP (RFC 3920 & 3921)
this is the preliminary result of that wrestling (you should see the
other guy!): XmppSerializer allows us to serialize Xmpp stanza (and
theoretically deserialize [or reify] them), XmppWriter helps avoiding
various gratuitous crap added in by off-the-shelf XmlSerializer.
this is currently not used anywhere but the plan is to use it for
at least an XMPPBridgeModule.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/XMPP/XmppWriter.cs (renamed from OpenSim/Framework/Communications/XMPP/Stanza.cs) | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/OpenSim/Framework/Communications/XMPP/Stanza.cs b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs index 3930bac..c5ad9b4 100644 --- a/OpenSim/Framework/Communications/XMPP/Stanza.cs +++ b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs | |||
@@ -25,31 +25,34 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System.IO; |
29 | using System.Text; | ||
29 | using System.Xml; | 30 | using System.Xml; |
30 | 31 | ||
32 | using IOStream = System.IO.Stream; | ||
33 | |||
31 | namespace OpenSim.Framework.Communications.XMPP | 34 | namespace OpenSim.Framework.Communications.XMPP |
32 | { | 35 | { |
33 | public class Stanza | 36 | public class XMPPWriter: XmlTextWriter |
34 | { | 37 | { |
35 | public string localName = String.Empty; | 38 | public XMPPWriter(TextWriter textWriter) : base(textWriter) |
36 | public JId to; | 39 | { |
37 | public JId from; | 40 | } |
38 | public string id; | ||
39 | public string lang; | ||
40 | public string nodeName; | ||
41 | 41 | ||
42 | public Stanza(XmlNode node, Object defaults, bool hasID) | 42 | public XMPPWriter(IOStream stream) : this(stream, Encoding.UTF8) |
43 | { | 43 | { |
44 | } | ||
44 | 45 | ||
46 | public XMPPWriter(IOStream stream, Encoding enc) : base(stream, enc) | ||
47 | { | ||
45 | } | 48 | } |
46 | //public virtual XmlElement getNode() | 49 | |
47 | //{ | 50 | public override void WriteStartDocument() |
48 | //return new XmlElement(); | 51 | { |
49 | //} | 52 | } |
50 | public virtual string generateId() | 53 | |
54 | public override void WriteStartDocument(bool standalone) | ||
51 | { | 55 | { |
52 | return ""; | ||
53 | } | 56 | } |
54 | } | 57 | } |
55 | } | 58 | } |