aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-22 20:19:15 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-22 20:19:15 +0200
commitc26015503aa0fbca37abdfc4870ac94bb7befeee (patch)
treee21da0a7f4c9cea25c08564eedb7be0549cc2466 /lib
parentc50420a0f2df7a7bf291312c38ac43e2c9f58141 (diff)
downloadlibquotient-c26015503aa0fbca37abdfc4870ac94bb7befeee.tar.gz
libquotient-c26015503aa0fbca37abdfc4870ac94bb7befeee.zip
Drop other stuff deprecated pre- or early 0.6
BaseJob: StatusCode::JsonParseError Connection: resolved() and reconnected() signals; roomMap(); postReceipt() User: bridged() and rawName() ConnectionData: setHost() and setPort() StateEventBase: prev_content()
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp21
-rw-r--r--lib/connection.h45
-rw-r--r--lib/connectiondata.cpp12
-rw-r--r--lib/connectiondata.h4
-rw-r--r--lib/events/stateevent.h4
-rw-r--r--lib/jobs/basejob.h2
-rw-r--r--lib/user.cpp4
-rw-r--r--lib/user.h18
8 files changed, 1 insertions, 109 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 7dd04aaa..222c3b71 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -314,8 +314,6 @@ void Connection::resolveServer(const QString& mxid)
setHomeserver(maybeBaseUrl);
}
Q_ASSERT(d->loginFlowsJob != nullptr); // Ensured by setHomeserver()
- connect(d->loginFlowsJob, &BaseJob::success, this,
- &Connection::resolved);
connect(d->loginFlowsJob, &BaseJob::failure, this, [this] {
qCWarning(MAIN) << "Homeserver base URL sanity check failed";
emit resolveError(tr("The homeserver doesn't seem to be working"));
@@ -795,11 +793,6 @@ void Connection::stopSync()
QString Connection::nextBatchToken() const { return d->data->lastEvent(); }
-PostReceiptJob* Connection::postReceipt(Room* room, RoomEvent* event)
-{
- return callApi<PostReceiptJob>(room->id(), "m.read", event->id());
-}
-
JoinRoomJob* Connection::joinRoom(const QString& roomAlias,
const QStringList& serverNames)
{
@@ -1239,20 +1232,6 @@ int Connection::millisToReconnect() const
return d->syncJob ? d->syncJob->millisToRetry() : 0;
}
-QHash<QPair<QString, bool>, Room*> Connection::roomMap() const
-{
- // Copy-on-write-and-remove-elements is faster than copying elements one by
- // one.
- QHash<QPair<QString, bool>, Room*> roomMap = d->roomMap;
- for (auto it = roomMap.begin(); it != roomMap.end();) {
- if (it.value()->joinState() == JoinState::Leave)
- it = roomMap.erase(it);
- else
- ++it;
- }
- return roomMap;
-}
-
QVector<Room*> Connection::allRooms() const
{
QVector<Room*> result;
diff --git a/lib/connection.h b/lib/connection.h
index a7a071f3..ecbb1a19 100644
--- a/lib/connection.h
+++ b/lib/connection.h
@@ -138,15 +138,6 @@ public:
explicit Connection(const QUrl& server, QObject* parent = nullptr);
~Connection() override;
- /// Get all Invited and Joined rooms
- /*!
- * \return a hashmap from a composite key - room name and whether
- * it's an Invite rather than Join - to room pointers
- * \sa allRooms, rooms, roomsWithTag
- */
- [[deprecated("Use allRooms(), roomsWithTag() or rooms(joinStates) instead")]]
- QHash<QPair<QString, bool>, Room*> roomMap() const;
-
/// Get all rooms known within this Connection
/*!
* This includes Invite, Join and Leave rooms, in no particular order.
@@ -524,30 +515,12 @@ public Q_SLOTS:
*/
void assumeIdentity(const QString& mxId, const QString& accessToken,
const QString& deviceId);
- /*! \deprecated Use loginWithPassword instead */
- void connectToServer(const QString& userId, const QString& password,
- const QString& initialDeviceName,
- const QString& deviceId = {})
- {
- loginWithPassword(userId, password, initialDeviceName, deviceId);
- }
- /*! \deprecated
- * Use assumeIdentity() if you have an access token or
- * loginWithToken() if you have a login token.
- */
- void connectWithToken(const QString& userId, const QString& accessToken,
- const QString& deviceId)
- {
- assumeIdentity(userId, accessToken, deviceId);
- }
/// Explicitly request capabilities from the server
void reloadCapabilities();
/// Find out if capabilites are still loading from the server
bool loadingCapabilities() const;
- /** @deprecated Use stopSync() instead */
- void disconnectFromServer() { stopSync(); }
void logout();
void sync(int timeout = -1);
@@ -662,24 +635,7 @@ public Q_SLOTS:
/** \deprecated Do not use this directly, use Room::leaveRoom() instead */
virtual LeaveRoomJob* leaveRoom(Room* room);
- // Old API that will be abolished any time soon. DO NOT USE.
-
- /** @deprecated Use callApi<PostReceiptJob>() or Room::postReceipt() instead
- */
- virtual PostReceiptJob* postReceipt(Room* room, RoomEvent* event);
-
Q_SIGNALS:
- /**
- * @deprecated
- * This was a signal resulting from a successful resolveServer().
- * Since Connection now provides setHomeserver(), the HS URL
- * may change even without resolveServer() invocation. Use
- * loginFLowsChanged() instead of resolved(). You can also use
- * loginWith*() and assumeIdentity() without the HS URL set in
- * advance (i.e. without calling resolveServer), as they trigger
- * server name resolution from MXID if the server URL is not valid.
- */
- void resolved();
void resolveError(QString error);
void homeserverChanged(QUrl baseUrl);
@@ -687,7 +643,6 @@ Q_SIGNALS:
void capabilitiesLoaded();
void connected();
- void reconnected(); //< \deprecated Use connected() instead
void loggedOut();
/** Login data or state have changed
*
diff --git a/lib/connectiondata.cpp b/lib/connectiondata.cpp
index e54d909b..87ad4577 100644
--- a/lib/connectiondata.cpp
+++ b/lib/connectiondata.cpp
@@ -118,18 +118,6 @@ void ConnectionData::setToken(QByteArray token)
d->accessToken = std::move(token);
}
-void ConnectionData::setHost(QString host)
-{
- d->baseUrl.setHost(host);
- qCDebug(MAIN) << "updated baseUrl to" << d->baseUrl;
-}
-
-void ConnectionData::setPort(int port)
-{
- d->baseUrl.setPort(port);
- qCDebug(MAIN) << "updated baseUrl to" << d->baseUrl;
-}
-
const QString& ConnectionData::deviceId() const { return d->deviceId; }
const QString& ConnectionData::userId() const { return d->userId; }
diff --git a/lib/connectiondata.h b/lib/connectiondata.h
index 7dd96f26..e16a2dac 100644
--- a/lib/connectiondata.h
+++ b/lib/connectiondata.h
@@ -31,10 +31,6 @@ public:
void setBaseUrl(QUrl baseUrl);
void setToken(QByteArray accessToken);
- [[deprecated("Use setBaseUrl() instead")]]
- void setHost(QString host);
- [[deprecated("Use setBaseUrl() instead")]]
- void setPort(int port);
void setDeviceId(const QString& deviceId);
void setUserId(const QString& userId);
void setNeedsToken(const QString& requestName);
diff --git a/lib/events/stateevent.h b/lib/events/stateevent.h
index 1415f709..bc414a5f 100644
--- a/lib/events/stateevent.h
+++ b/lib/events/stateevent.h
@@ -100,10 +100,6 @@ public:
visitor(_content);
editJson()[ContentKeyL] = _content.toJson();
}
- [[deprecated("Use prevContent instead")]] const ContentT* prev_content() const
- {
- return prevContent();
- }
const ContentT* prevContent() const
{
return _prev ? &_prev->content : nullptr;
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h
index 7750fb8b..835cd822 100644
--- a/lib/jobs/basejob.h
+++ b/lib/jobs/basejob.h
@@ -52,8 +52,6 @@ public:
IncorrectRequestError = IncorrectRequest,
IncorrectResponse,
IncorrectResponseError = IncorrectResponse,
- JsonParseError //< \deprecated Use IncorrectResponse instead
- = IncorrectResponse,
TooManyRequests,
TooManyRequestsError = TooManyRequests,
RateLimited = TooManyRequests,
diff --git a/lib/user.cpp b/lib/user.cpp
index a4abed37..60920a59 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -93,8 +93,6 @@ QString User::name(const Room* room) const
return room ? room->memberName(id()) : d->defaultName;
}
-QString User::rawName(const Room* room) const { return name(room); }
-
void User::rename(const QString& newName)
{
const auto actualNewName = sanitized(newName);
@@ -185,8 +183,6 @@ QString User::fullName(const Room* room) const
return displayName.isEmpty() ? id() : (displayName % " (" % id() % ')');
}
-QString User::bridged() const { return {}; }
-
const Avatar& User::avatarObject(const Room* room) const
{
if (!room)
diff --git a/lib/user.h b/lib/user.h
index 4ff62951..78b72bf2 100644
--- a/lib/user.h
+++ b/lib/user.h
@@ -22,7 +22,6 @@ class User : public QObject {
Q_PROPERTY(QString name READ name NOTIFY defaultNameChanged)
Q_PROPERTY(QString displayName READ displayname NOTIFY defaultNameChanged STORED false)
Q_PROPERTY(QString fullName READ fullName NOTIFY defaultNameChanged STORED false)
- Q_PROPERTY(QString bridgeName READ bridged NOTIFY defaultNameChanged STORED false)
Q_PROPERTY(QString avatarMediaId READ avatarMediaId NOTIFY defaultAvatarChanged STORED false)
Q_PROPERTY(QUrl avatarUrl READ avatarUrl NOTIFY defaultAvatarChanged)
public:
@@ -40,18 +39,10 @@ public:
* This may be empty if the user didn't choose the name or cleared
* it. If the user is bridged, the bridge postfix (such as '(IRC)')
* is stripped out. No disambiguation for the room is done.
- * \sa displayName, rawName
+ * \sa displayName
*/
QString name(const Room* room = nullptr) const;
- /** Get the user name along with the bridge postfix
- * This function is similar to name() but appends the bridge postfix
- * (such as '(IRC)') to the user name. No disambiguation is done.
- * \sa name, displayName
- */
- [[deprecated("Bridge postfixes exist no more, use name() instead")]]
- QString rawName(const Room* room = nullptr) const;
-
/** Get the displayed user name
* When \p room is null, this method returns result of name() if
* the name is non-empty; otherwise it returns user id.
@@ -70,13 +61,6 @@ public:
*/
QString fullName(const Room* room = nullptr) const;
- /**
- * Returns the name of bridge the user is connected from or empty.
- */
- [[deprecated("Bridged status is no more supported; this always returns"
- " an empty string")]]
- QString bridged() const;
-
/** Whether the user is a guest
* As of now, the function relies on the convention used in Synapse
* that guests and only guests have all-numeric IDs. This may or