Age | Commit message (Collapse) | Author |
|
This is the first convenience function implemented inside the xmpp
module but for the goroutine of the using application.
|
|
Some parts of the `xmpp` module functionality should be written for the
using application software. To reference a running session more easily
it is an advantage to have an opaque struct for this instead of
decoupled channels.
|
|
|
|
This completes the roster get / result cycle which is needed for a MVP.
|
|
This asks the server for the roster / contact list for the current
account.
|
|
It is quite tricky to write structs with correct XML struct tags which
are suitable for RX and TX because in RX structs all possible fields
have to be addressed and in TX some have to be hidden depending on the
use case.
|
|
This makes the code way less complex.
|
|
|
|
This will cover all iq use cases with optional arguments and
sub-elements.
|
|
The bind request / response works with IQ stanzas. Because of the way
encoding and decoding is done with LimoX / the Go standard library it
makes sense to group IQ-based logic in a separat file since the struct
for IQs will be there.
|
|
|
|
This demonstrates the full one-to-one chat message backend without the
need to implement the GUI.
|
|
This sets a handler and the routing up to be able to log chat messages
with body and sender reference.
This can later be used for the GUI.
|
|
|
|
|
|
This was removed for refactoring.
|
|
This prevents collisions.
|
|
Was broken because of switch to new RX concept.
|
|
|
|
This helps to avoid duplicated code when new XML elements are described
as custom structs.
|
|
|
|
|
|
|
|
|
|
This uses xml.Decoder.DecodeElement() which makes parsing way easier.
This first step is just able to parse stream features partially.
|
|
The new router will be so trivial that it is not worth a unit test.
|
|
This is more suitable for the new RX concept.
|
|
This was empty and has no benefit.
|
|
This will not be used in the new RX concept.
|
|
The new RX concept will not need such an element buffer and uses the
xml.Decoder.DecodeElement() function instead.
|
|
This was not really necessary because it was all related to the
xmpp.session and should thus be implemented there.
Using the context package further reduced the complexity for
cancelation.
|
|
The encoderDecoder sub-struct of the session struct should be removed in
little steps. This is the first one.
|
|
This is way shorter and serves the same purpose: It reflects the
responsibility of encoding and decoding XML. The encoderDecoder struct
should be removed soon.
|
|
The fact that it is actually about a pair of XML streams is obvious and
not that relevant. A shorter name has a higher priority.
|
|
This required the trick of defining an empty struct as `presence` type
but works pretty well. For sending data EncodeElement instead of token
handling should always work. Since it is simpler it should be used.
|
|
|
|
|
|
LimoX does not care about these XML tokens at least for now. The issued
error messages on other levels.
Dropping those tokens on the encoderDecoder level asserts that the rest
of the xmpp code has only `clean` XML content to process.
|
|
The prefix has now more visual contrast to the XML content due to its
own bracket style.
Furthermore the indent for the TX stream was disabled. Indent is a nice
thing but it just makes sense if both streams are indented identically.
Since the RX stream received from the current development server has no
indent and also no newlines it is better to turn it of completely.
This might change in the future with structured logging (with the new
slog package) or command line flags to toggle this behaviour.
Re-encoding of the RX stream could also be an option but should stay one
because it alters the RX stream and might hide errors during debugging.
|
|
The prefix is re-implemented with this commit to distinguish between RX
and TX XML. Furthermore the logging is now based on the log module to
have the same (e.g. timestamp) prefix as other log messages.
|
|
This commit uses an io.TeeReader to achieve the same goal for RX like in
the previous commit for TX.
|
|
Using an io.MultiWriter it is trivially possible to write encoded tokens
to the TCP channel aswell as to stdout.
The disadvantage is that it is not possible to inject prefix data like
the so far used `C: ` only for stdout and not for the TCP channel. Such
a prefix is not wanted in the TCP channel and thus not wanted for both.
The solution to get a nice log is to implement a transparent logging
middleware which gets the raw TX stream and inserts a prefix at each
line before sending to stdout.
|
|
This completes the connection process.
|
|
|
|
This handler is just a placeholder for a more extensive IQ handling but
already writes to the log so that it is obvious what is happening.
|
|
This is the first step of resource binding which is a mandatory part of
establishing an XMPP connection.
|
|
This allows to trigger resource binding if the stream supports it.
|
|
|
|
Writing to the log is still better than doing nothing ...
|
|
The new structure allows to check for different stream features and act
according to them or - if nothing matches - do nothing apart from an
error message to the log.
|