Skip to content

Conversation

CarlSchwan
Copy link
Contributor

No description provided.

@CarlSchwan CarlSchwan marked this pull request as draft March 3, 2024 16:21
kdesysadmin pushed a commit to KDE/neochat that referenced this pull request Mar 3, 2024
static Connection* makeMockConnection(const QString& mxId,
bool enableEncryption = E2EE_Enabled);

static Connection* makeMockConnection(Connection *connection, const QString& mxId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this API looks weird, why is it a static function that's passed an object?

Looking at the neochat MR for this, it seems that we could easily use the existing makeMockConnection function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue with the existing function is that it return a Connection * and not a NeoChatConnection *

Copy link
Member

@KitsuneRal KitsuneRal Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AccountRegistry looks like a good place for it? Then you could derive from it and override a virtual function. Or simply making makeMockConnection() a template would also work I guess (would need pulling completeSetup() from Connection::Private to Connection but that's a smaller evil)?

Room* provideRoom(const QString& roomId,
Omittable<JoinState> joinState = none);

//! Add room to the connection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also mention that this is only for tests and not useful in normal operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants