Optimization: only connect the current model to the account

Authored by dfaure on Feb 7 2020, 9:42 PM.

Description

Optimization: only connect the current model to the account

Summary:
Otherwise for each image being downloaded, the code was searching in
al messages of all models. Pretty wasteful.

Test Plan:
Remove ~/.cache/ruqola, go to room with inline image.
Debug output in MessageModel went from 50 calls to just 1.
Only tested in widgets version, since the qml version crashes yet again.

Reviewers: mlaurent, kfunk

Differential Revision: https://phabricator.kde.org/D27227

Details