diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-08-31 17:57:27 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-08-31 18:01:04 +0900 |
commit | 4004992d8dd55ee27c3d39434d6a4498b8f515ef (patch) | |
tree | 85a68a8db1f05dc3a229266f9647627b44f38657 | |
parent | 76241cb772bb53901cdd3308262f76ba718d9a47 (diff) | |
download | libquotient-4004992d8dd55ee27c3d39434d6a4498b8f515ef.tar.gz libquotient-4004992d8dd55ee27c3d39434d6a4498b8f515ef.zip |
Room: Drop unused code
-rw-r--r-- | room.cpp | 96 | ||||
-rw-r--r-- | room.h | 3 |
2 files changed, 0 insertions, 99 deletions
@@ -51,8 +51,6 @@ class Room::Private Room* q; - //static LogMessage* parseMessage(const QJsonObject& message); - // This updates the room displayname field (which is the way a room // should be shown in the room list) It should be called whenever the // list of members or the room name (m.room.name) or canonical alias change. @@ -330,18 +328,6 @@ QString Room::roomMembername(QString userId) const return roomMembername(connection()->user(userId)); } -void Room::addMessage(Event* event) -{ - processMessageEvent(event); - emit newMessage(event); - //d->addState(event); -} - -void Room::addInitialState(State* state) -{ - processStateEvent(state->event()); -} - void Room::updateData(const SyncRoomData& data) { if( d->prevBatch.isEmpty() ) @@ -578,85 +564,3 @@ void Room::Private::updateDisplayname() if (old_name != displayname) emit q->displaynameChanged(q); } - -// void Room::setAlias(QString alias) -// { -// d->alias = alias; -// emit aliasChanged(this); -// } -// -// bool Room::parseEvents(const QJsonObject& json) -// { -// QList<LogMessage*> newMessages; -// QJsonValue value = json.value("messages").toObject().value("chunk"); -// if( !value.isArray() ) -// { -// return false; -// } -// QJsonArray messages = value.toArray(); -// for(const QJsonValue& val: messages ) -// { -// if( !val.isObject() ) -// continue; -// LogMessage* msg = Private::parseMessage(val.toObject()); -// if( msg ) -// { -// newMessages.append(msg); -// } -// -// } -// addMessages(newMessages); -// return true; -// } -// -// bool Room::parseSingleEvent(const QJsonObject& json) -// { -// qDebug() << "parseSingleEvent"; -// LogMessage* msg = Private::parseMessage(json); -// if( msg ) -// { -// addMessage(msg); -// return true; -// } -// return false; -// } -// -// bool Room::parseState(const QJsonObject& json) -// { -// QJsonValue value = json.value("state"); -// if( !value.isArray() ) -// { -// return false; -// } -// QJsonArray states = value.toArray(); -// for( const QJsonValue& val: states ) -// { -// QJsonObject state = val.toObject(); -// QString type = state.value("type").toString(); -// if( type == "m.room.aliases" ) -// { -// QJsonArray aliases = state.value("content").toObject().value("aliases").toArray(); -// if( aliases.count() > 0 ) -// { -// setAlias(aliases.at(0).toString()); -// } -// } -// } -// return true; -// } -// -// LogMessage* Room::Private::parseMessage(const QJsonObject& message) -// { -// if( message.value("type") == "m.room.message" ) -// { -// QJsonObject content = message.value("content").toObject(); -// if( content.value("msgtype").toString() != "m.text" ) -// return 0; -// QString user = message.value("user_id").toString(); -// QString body = content.value("body").toString(); -// LogMessage* msg = new LogMessage( LogMessage::UserMessage, body, user ); -// return msg; -// } -// return 0; -// } - @@ -30,7 +30,6 @@ namespace QMatrixClient { class Event; - class State; class Connection; class User; @@ -65,8 +64,6 @@ namespace QMatrixClient */ Q_INVOKABLE QString roomMembername(QString userId) const; - Q_INVOKABLE void addMessage( Event* event ); - Q_INVOKABLE void addInitialState( State* state ); Q_INVOKABLE void updateData( const SyncRoomData& data ); Q_INVOKABLE void setJoinState( JoinState state ); |