-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pr09 - Complete parser rewrite, XEP-0172, XEP-0084, OMEMO fixes #506
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This moves a bunch of omemo related code into a new MLOMEMO class
- Own device ids can now be deleted (bundles will be keeped on the server) - preKeyIds will increment (preKeyIds will be used twice if the last preKeyId from the bundle was chosen -> Should be fixed in part 3) - Fix crash while sending bundle
This will remove all special loglines from console output and allows us to use our log formatter for file/udp *and* console logging
This allows the user to open the app and manually synchronize (e.g. receive and send) messages, for example after a push that could not fetch messages or when sending a message while having bad/no connectivity. The notification will automatically be removed once all accounts are syncronized again (either because the user opened the app or because the ios 13 bgtask or a push triggered a sync)
This rewrites the parser to parse incoming XML into a tree of MLXMLNodes that can be serialized back to an XML string and queried for their information using a query language similar to prosody's find() method in util.stanza (see https://prosody.im/doc/developers/util/stanza ). We implement a superset of this language by extending it with some more sophisticated features like querying the current node, extracting the elementName of the selected node or useing ".." to ascend to the parent of a node together with "*" and "{*}" for "any element" and "any namespace". Unlike prosody's find() our find: method returns an NSArray of all nodes or extracted values matching the query string, not only the first one. The findFirst: method can be used to get only the first node/value. The check: method returns a BOOL that is YES if the find: method returned one or more entries and NO if the NSArray returned by find: was empty. Our query language supports data conversion commands, too: queries with extraction commands can have data conversion commands appended, like "|bool", "|int", "|datetime" or even "|base64" which converts the xml strings into a BOOL, NSNumber, NSDate or NSData. The added extraction command "@@" will extract the raw attribute dictionary of the found nodes. The extraction command "$" extracts the name of the found element. Co-authored-by: Friedrich Altheide <11352905+FriedrichAltheide@users.noreply.github.com>
This fixes some bugs, too.
- cleanup old preKeys - send updated bundle after preKey was used - create list und devices id's with a broken session -> TODO: cerate new session
This adds a new method to create a data forms entry named createFormEntry:withValue:andType:
This simplifies handling of PEP based XEPs
- publish devices via new pubsub interface - publish bundle via new pubsub interface
Origin ids are defined in XEP-0359
ready to be merged now :) |
This was
linked to
issues
Nov 2, 2020
This adds a new syntax for defining and calling serializable handlers implemented by MLHandler and usable through various convenience methods: - Define handler method (this will be a static class method and doesn't have to be declared in any interface to be usable). The argument number or order does not matter, feel free to reorder or even remove arguments you don't need. Syntax: ``` $$handler(myHandlerName, $ID(xmpp*, account), $BOOL(success)) // your code comes here // variables defined/imported: account, success // variables that could be defined/imported: var1, success, account $$ ``` - Call defined handlers by: ``` MLHandler* h = makeHandler(ClassName, myHandlerName); [h call]; ``` - You can bind variables to MLHandler objects when creating them or when invoking them. Variables supplied on invocation overwrite variables supplied when creating the handler if the names are equal. Variables bound to the handler when creating it have to conform to the NSCoding protocol to make the handler serializable. Variable binding example: ``` MLHandler* h = makeHandlerWithArgs(ClassName, myHandlerName, (@{ @"var1": @"value", @"success": @yES })); [h callWithArguments:@{ @"account": xmppAccount }]; ``` - Usable shortcuts to create MLHandler objects: - makeHandler(delegate, name) - makeHandlerWithArgs(delegate, name, args) - makeHandlerWithInvalidation(delegate, name, invalidation) - makeHandlerWithInvalidationAndArgs(delegate, name, invalidation, args) - You can add an invalidation method to a handler when creating the MLHandler object (after invalidating a handler you can not call or invalidate it again!): ``` // definition of normal handler method $$handler(myHandlerName, $ID(xmpp*, account), $BOOL(success)) // your code comes here $$ // definition of invalidation method $$handler(myInvalidationName, $BOOL(done), $ID(NSString*, var1)) // your code comes here // variables defined/imported: var1, done // variables that could be defined/imported: var1, success, done $$ MLHandler* h = makeHandlerWithInvalidationAndArgs(ClassName, myHandlerName, myInvalidationName, (@{ @"var1": @"value", @"success": @yES })); // call invalidation method with "done" argument [h callInvalidationWithArguments:@{ @"done": @yES }] ```
This was
linked to
issues
Nov 6, 2020
Closed
This makes all variable bindings aware of primitive types and allows to bind nil values, too. The complete handler implementation is now encapuslated by proper macros. This adds support for invalidation of account states without loosing unacked outgoing messages.
anurodhp
approved these changes
Nov 8, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🎨 UI
Related to visual appreance of the app (User Interface)
📑 XEP
Refers to relevant or issued XEPs
🐟 OMEMO
Related to OMEMO Encryption
🚫 Bug / Stability
Releated directly to bugs or instability issues
🎉 Feature
Idea or new feature to implement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old parser test are not yet adapted to the new parser system, travis tests will fail