This rewrites quite a lot of QueryMatcher.
* Remove FuzzyMatcher which was a whole file of commented out code
that just deferred to QueryMatcher
* Simplify & remove some cruft from QueryMatcher, eg. most of the
KeyMap stuff was completely unused.
* Don't rely on object iteration order, which fixes a bug where
users whose display names were entirely numeric would always
appear first...
* Add options.funcs to QueryMatcher to allow for indexing by things
other than keys on the objects
* Use above to index users by username minus the leading '@'
* Don't include the '@' in the query when autocomple is triggered
by typing '@'.
Fixes https://github.com/vector-im/riot-web/issues/6782
_sortedUniq claims to be like _uniq but optimised for sorted arrays - https://lodash.com/docs/4.17.4#sortedUniqBy. But in practice this isn't quite true, so stick with the unoptimised version.
QueryMatcher: sort results based on the position of the query within the matching value. The closer to the beginning of the word, the higher the result apears.
UserProvider: perf improvement (slice early) and refactor onUserSpoke
When a fully plaintext, ascii emoji is typed like ";-)", pressing tab will suggest emojione to replace it with based off of the meta data provided by emojione.
e.g. the aliases_ascii for `😃` are [":D",":-D","=D"] so typing ":D *tab*" will insert a real 😃