Skip to content
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
merged 190 commits into from
Nov 8, 2020
Merged

Pr09 - Complete parser rewrite, XEP-0172, XEP-0084, OMEMO fixes #506

merged 190 commits into from
Nov 8, 2020

Conversation

tmolitor-stud-tu
Copy link
Member

@tmolitor-stud-tu tmolitor-stud-tu commented Oct 30, 2020

  • Floating scroll to bottom button
  • Notification Privacy Setting Options UI
  • Complete parser rewrite (including a new project specific XML query language and abstractions for pubsub/pep, data forms and XMPP stanza elements)
  • XEP-0172: Nicknames (set own nickname, read other nicknames)
  • XEP-0084: User Avatar (set own avatar)
  • Actions for notifications (mark as read, direct reply)
  • Improve chat scrolling
  • Many fixes, clean-up and improvements to for OMEMO and UI
  • /me command
  • Use roster names or nicknames for name display instead of jid
  • Support for XEP-0333 displayed/read markers synchonizing read state across devices and removing notifications for messages read on another device

The old parser test are not yet adapted to the new parser system, travis tests will fail

FriedrichAltheide and others added 30 commits October 24, 2020 07:21
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
Fix the problem which the position of button will wrong when iPad rotate orientation .
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
@tmolitor-stud-tu tmolitor-stud-tu changed the title WIP: Pr09 Pr09 Nov 2, 2020
@tmolitor-stud-tu
Copy link
Member Author

ready to be merged now :)

@Echolon Echolon changed the title Pr09 Pr09 - Complete parser rewrite, XEP-0172, XEP-0084, OMEMO fixes Nov 2, 2020
tmolitor-stud-tu and others added 12 commits November 3, 2020 07:00
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 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 anurodhp merged commit 6792041 into monal-im:develop Nov 8, 2020
@Echolon Echolon linked an issue Nov 28, 2020 that may be closed by this pull request
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
Projects
None yet
5 participants