nheko icon indicating copy to clipboard operation
nheko copied to clipboard

Please change hardcoded matrix.to to homeserver

Open veikolippand opened this issue 1 year ago • 3 comments

Describe the bug

Can we please replace hardcoded matrix.to server with the correct user homeserver. I consider this as a bug, because for example if i tag user in chat the url will point to wrong server (url is https://matrix.to/#/blah) instead of my current homeserver.

Simple grep shows that there are several places in code where matrix.to is used. Maybe some of them are ok, i don't know purpose for all these but i am sure that some of them should be homeserver instead.

src/UsersModel.cpp:69:                return QStringLiteral("[%1](https://matrix.to/#/%2)")
src/Config.h:82:  matrixToLink(QStringLiteral(R"(<a href=\"(https://matrix.to/#/.*?)\">(.*?)</a>)"));
src/Utils.cpp:968:                   "href=\"https://matrix.to/#/%1/%2\">In reply "
src/Utils.cpp:969:                   "to</a> <a href=\"https://matrix.to/#/%3\">%4</a><br"
src/timeline/TimelineModel.cpp:1968:    return QStringLiteral("https://matrix.to/#/%1").arg(QString(QUrl::toPercentEncoding(room)));
src/timeline/InputBar.cpp:387:        int endOfName = input.indexOf("](https://matrix.to/#/");
src/ChatPage.cpp:1490:    // Convert matrix.to URIs to proper format
src/ChatPage.cpp:1491:    if (uri_.scheme() == QLatin1String("https") && uri_.host() == QLatin1String("matrix.to")) {
src/RoomsModel.cpp:48:                return QStringLiteral("[%1](https://matrix.to/#/%2)")

To Reproduce

Chat.

What happened?

No response

Expected behavior

No response

Screenshots

No response

Version

0.11.3

Operating system

No response

Installation method

No response

Qt version

No response

C++ compiler

No response

Desktop Environment

No response

Did you use profiles?

  • [ ] Profiles used?

Relevant log output

No response

Backtrace

No response

veikolippand avatar Jan 15 '24 10:01 veikolippand

matrix.to is not a homeserver, it's a redirection page, which includes the homeserver of the target (user, room, etc) in the path parameter. For example, tagging my alt account results in https://matrix.to/#/%40temporarynep%3Amatrix.org, and tagging my main account results in https://matrix.to/#/%40nep_nep%3Amatrix.bottomservices.club.

NepNep21 avatar Jan 19 '24 16:01 NepNep21

I would also love to see proper matrix: links instead of the matrix.to that I oppose as a principle.

  • https://spec.matrix.org/latest/appendices/#matrix-uri-scheme

Mikaela avatar Jan 19 '24 18:01 Mikaela

matrix.to is not a homeserver, it's a redirection page, which includes the homeserver of the target (user, room, etc) in the path parameter. For example, tagging my alt account results in https://matrix.to/#/%40temporarynep%3Amatrix.org, and tagging my main account results in https://matrix.to/#/%40nep_nep%3Amatrix.bottomservices.club.

Ok, in that sense can we please change it to home server as so that some unknown external redirection services are not used in for example closed networks. Even tho matrix.to might not be unknown for many it is generally unknown entity from the private network perspective.

veikolippand avatar Jan 21 '24 08:01 veikolippand