summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-31WIP: Update to gioui.org v0.7.1updatexengineering
TODO: There is a race condition. It has to be fixed since the program immediately crashes. Building the software is possible.
2023-09-04Merge branch 'update'HEADmainxengineering
This updates from gioui.org v0.1.0 to v0.3.0.
2023-09-04Update to gioui.org v0.3.0xengineering
2023-09-04Update to gioui.org v0.2.0xengineering
2023-07-06Merge branch 'roster-backend'xengineering
Getting the roster (contact list) is crucial to provide a MVP LimoX since the chats should be grouped by contacts. For the MVP it is only relevant to get the roster on connect. Everything else can be done later.
2023-07-06Apply go fmtxengineering
2023-07-06Implement roster result handlingxengineering
This completes the roster get / result cycle which is needed for a MVP.
2023-07-06Implement roster get requestxengineering
This asks the server for the roster / contact list for the current account.
2023-07-06Use different IQ struct for RX and TXxengineering
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.
2023-07-05Migrate bind sending to new generic iq structxengineering
This makes the code way less complex.
2023-07-05Migrate bind receive to new iq structxengineering
2023-07-05Add new generic iq structxengineering
This will cover all iq use cases with optional arguments and sub-elements.
2023-07-05Move bind logic to new xmpp/iq.goxengineering
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.
2023-07-05Merge branch 'msg-backend'xengineering
This adds the XMPP functionality to send and receive XMPP text messages in one-to-one chats.
2023-07-05Apply go fmtxengineering
2023-07-05Implement echo botxengineering
This demonstrates the full one-to-one chat message backend without the need to implement the GUI.
2023-07-04Implement (chat) message receiving backendxengineering
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.
2023-07-04Merge branch 'element-handling'xengineering
This moves away from the concept to parse each individual XML token from the token and group them as a []xml.Token slice for further processing. While this is still possible, receiving aswell as sending has switched to define structs with XML tags which can be marshalled and unmarshalled with the xml.Encoder.EncodeElement() and xml.Decoder.DecodeElement() functions. Further documentation can be found at https://pkg.go.dev/encoding/xml#Unmarshal and https://pkg.go.dev/encoding/xml#Marshal. This merge reduces with its changes the number of code lines in the XMPP implementation by around 41 percent!
2023-07-04Apply go fmtxengineering
2023-07-04Remove unused codexengineering
2023-07-04Re-implement resource binding and presencexengineering
This was removed for refactoring.
2023-07-04Add namespace to streamFeatures structxengineering
This prevents collisions.
2023-07-04Re-implement SASLxengineering
Was broken because of switch to new RX concept.
2023-07-04Introduce handle() as dummyxengineering
2023-07-04Implement XML element parsing with Genericxengineering
This helps to avoid duplicated code when new XML elements are described as custom structs.
2023-07-04Rework routing completelyxengineering
2023-07-04Further reduce complexity of streamFeatures structxengineering
2023-07-04Just pass parsed data if successfulxengineering
2023-07-04Reduce complexity of streamFeatures structxengineering
2023-07-04First working version of new RX conceptxengineering
This uses xml.Decoder.DecodeElement() which makes parsing way easier. This first step is just able to parse stream features partially.
2023-07-04Remove unit test for routerxengineering
The new router will be so trivial that it is not worth a unit test.
2023-07-04Re-implement stream open and closexengineering
This is more suitable for the new RX concept.
2023-07-04Remove xmpp.presence typexengineering
This was empty and has no benefit.
2023-07-04Remove runStreamPair()xengineering
This will not be used in the new RX concept.
2023-07-04Remove element_bufferxengineering
The new RX concept will not need such an element buffer and uses the xml.Decoder.DecodeElement() function instead.
2023-07-03Remove encoderDecoder struct completelyxengineering
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.
2023-07-03Move xml.Encoder to session structxengineering
The encoderDecoder sub-struct of the session struct should be removed in little steps. This is the first one.
2023-07-03Rename encoder_decoder.go to xml.goxengineering
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.
2023-07-03Rename stream_pair.go to streams.goxengineering
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.
2023-07-03Use xml.Encoder.EncodeElement() for presencexengineering
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.
2023-07-03Switch to EncodeElement() for resource bindingxengineering
2023-07-03Switch to EncodeElement() for SASL authxengineering
2023-07-03Update to Gio v0.1.0xengineering
Gio started to use releases. LimoX should take advantage of this.
2023-07-03Merge branch 'fix-btn-callback-race'xengineering
This fixes a race condition which was discovered during testing with a bad network connection. Good network connections seem to hide this error.
2023-07-03Remove intended breakagexengineering
This removes the injected broken code which made the race condition reproducible.
2023-07-03Fix race condition on struct Limoxxengineering
To make message passing to the XMPP session channel non-blocking short living Goroutines are used. Before this commit they were executing closures which capture l as xengineering.eu/limox.Limox pointer and used it to get the channel where the message should be passed to. While channels are safe with respect to race conditions, structs are not. Thus the member access of the Limox struct was a race condition in certain side cases like bad network connection where those Goroutines lived for a longer time. The solution is to make a copy of the l.sessionIn channel and use this copy in the closures. This is valid since channels do not need pointers to them and furthermore are thread safe.
2023-07-03BROKEN: Make bug reliablexengineering
This should make the race appear reliable if a second connection attempt is made. It is important to have a reliable error to fix it reliably.
2023-07-01Merge branch 'byte-based-logging'xengineering
Logging used to re-encode tokens for receive logging and double-encode tokens for send logging. This had the flexibility to pretty-print the XML. Furthermore it was trivial to prepend a prefix like `S: ` and `C: ` for server and client. This merge moves away from logging based on re-encoding XML tokens. Instead the received or sent bytes are multiplexed to a logger which uses the log module of the standard library to log the XML code. These advantages come with this merge: - [TX] / [RX] instead of C: / S: as prefixes (direction instead of node) - encoding issues can be debugged via the log - everything is now logged via the log module and has timestamps The only disadvantage is that the logged XML is not pretty-printed anymore. This is choosen for the RX stream to not accidentally hide encoding issues and show what is really on the wire. That argument is true for TX aswell and consistency is appreciated anyway.
2023-07-01Drop xml.{ProcInst,Directive,Comment}xengineering
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.
2023-07-01Improve prefix and disable indentxengineering
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.