Commit f55f8044 authored by armin's avatar armin
Browse files

faster insertion of channels into view

parent 5a15fd3b
...@@ -58,8 +58,9 @@ QVariant ChannelModel::data( const QModelIndex &index, int role ) const ...@@ -58,8 +58,9 @@ QVariant ChannelModel::data( const QModelIndex &index, int role ) const
if ( message->getMessageType() == QStringLiteral( "file" ) || message->getMessageType() == QStringLiteral( "image" ) || message->getMessageType() == QStringLiteral( "audio" ) ) { if ( message->getMessageType() == QStringLiteral( "file" ) || message->getMessageType() == QStringLiteral( "image" ) || message->getMessageType() == QStringLiteral( "audio" ) ) {
return tr( QByteArrayLiteral( "file upload" ) ); return tr( QByteArrayLiteral( "file upload" ) );
} }
auto messageText =message->getMessageString();
messageText = messageText.replace("<img height='20' width='20'","<img height='10' width='10'"); auto messageText = message->getMessageString();
messageText = messageText.replace( "<img height='20' width='20'", "<img height='10' width='10'" );
return messageText; return messageText;
} }
...@@ -147,13 +148,15 @@ bool ChannelModel::addChannel( const QSharedPointer<RocketChatChannel> &channel ...@@ -147,13 +148,15 @@ bool ChannelModel::addChannel( const QSharedPointer<RocketChatChannel> &channel
connect( channel.data(), &RocketChatChannel::unreadMessagesChanged, this, &ChannelModel::onUnreadMessageChanged, Qt::UniqueConnection ); connect( channel.data(), &RocketChatChannel::unreadMessagesChanged, this, &ChannelModel::onUnreadMessageChanged, Qt::UniqueConnection );
connect( channel.data(), &RocketChatChannel::dataChanged, this, &ChannelModel::onDataChanged, Qt::UniqueConnection ); connect( channel.data(), &RocketChatChannel::dataChanged, this, &ChannelModel::onDataChanged, Qt::UniqueConnection );
connect( channel.data(), &RocketChatChannel::channelDeleted, this, &ChannelModel::onDeleted, Qt::UniqueConnection ); connect( channel.data(), &RocketChatChannel::channelDeleted, this, &ChannelModel::onDeleted, Qt::UniqueConnection );
connect(channel.data(), &RocketChatChannel::updatedChanged, this, &ChannelModel::onChannelOrderChanged); connect( channel.data(), &RocketChatChannel::updatedChanged, this, &ChannelModel::onChannelOrderChanged );
duplicateCheck.insert( channel->getRoomId() ); duplicateCheck.insert( channel->getRoomId() );
int pos = channelList.findPosition( channel ); int pos = channelList.findPosition( channel );
if(pos <0){
if ( pos < 0 ) {
pos = 0; pos = 0;
} }
beginInsertRows( QModelIndex(), pos, pos ); beginInsertRows( QModelIndex(), pos, pos );
channelList.insertSort( channel ); channelList.insertSort( channel );
endInsertRows(); endInsertRows();
...@@ -165,32 +168,35 @@ bool ChannelModel::addChannel( const QSharedPointer<RocketChatChannel> &channel ...@@ -165,32 +168,35 @@ bool ChannelModel::addChannel( const QSharedPointer<RocketChatChannel> &channel
} }
bool ChannelModel::addChannelsSlot(const QVector<QSharedPointer<RocketChatChannel> > &pChannels) bool ChannelModel::addChannelsSlot( const QVector<QSharedPointer<RocketChatChannel> > &pChannels )
{ {
// beginResetModel(); // beginResetModel();
int from =-1; int from = -1;
int to = -1; int to = -1;
for(const auto &channel: pChannels){
if ( !channel.isNull() && channel->getRoomId() != "" && !duplicateCheck.contains( channel->getRoomId() ) ) { for ( const auto &channel : pChannels ) {
if ( !channel.isNull() && !channel->getRoomId().isEmpty() && !duplicateCheck.contains( channel->getRoomId() ) ) {
//connect( channel.data(), &RocketChatChannel::messageAdded, this, &ChannelModel::onNewerMessage, Qt::UniqueConnection ); //connect( channel.data(), &RocketChatChannel::messageAdded, this, &ChannelModel::onNewerMessage, Qt::UniqueConnection );
connect( channel.data(), &RocketChatChannel::unreadMessagesChanged, this, &ChannelModel::onUnreadMessageChanged, Qt::UniqueConnection ); connect( channel.data(), &RocketChatChannel::unreadMessagesChanged, this, &ChannelModel::onUnreadMessageChanged, Qt::UniqueConnection );
connect( channel.data(), &RocketChatChannel::dataChanged, this, &ChannelModel::onDataChanged, Qt::UniqueConnection ); connect( channel.data(), &RocketChatChannel::dataChanged, this, &ChannelModel::onDataChanged, Qt::UniqueConnection );
connect( channel.data(), &RocketChatChannel::channelDeleted, this, &ChannelModel::onDeleted, Qt::UniqueConnection ); connect( channel.data(), &RocketChatChannel::channelDeleted, this, &ChannelModel::onDeleted, Qt::UniqueConnection );
connect(channel.data(), &RocketChatChannel::updatedChanged, this, &ChannelModel::onChannelOrderChanged); connect( channel.data(), &RocketChatChannel::updatedChanged, this, &ChannelModel::onChannelOrderChanged );
duplicateCheck.insert( channel->getRoomId() ); duplicateCheck.insert( channel->getRoomId() );
auto index = channelList.insertSort( channel ); auto index = channelList.insertSort( channel );
if(from == -1){ if ( from == -1 ) {
from = index; from = index;
to = index; to = index;
} }
if(index<from){
if ( index < from ) {
from = index; from = index;
}else if(index>to){ } else if ( index > to ) {
to = index; to = index;
} }
} }
} }
beginInsertRows( QModelIndex(), from, to ); beginInsertRows( QModelIndex(), from, to );
endInsertRows(); endInsertRows();
// endResetModel(); // endResetModel();
...@@ -308,14 +314,13 @@ void ChannelModel::onDeleted( const QString &pId, bool deleted ) ...@@ -308,14 +314,13 @@ void ChannelModel::onDeleted( const QString &pId, bool deleted )
} }
void ChannelModel::onChannelOrderChanged(const QString &pId, qint64 pTimestamp) void ChannelModel::onChannelOrderChanged( const QString &pId, qint64 pTimestamp )
{ {
static int counter = 0; static int counter = 0;
counter++; counter++;
qDebug() << counter; qDebug() << counter;
beginResetModel(); auto changed = channelList.reOrder();
channelList.reOrder(); emit dataChanged( createIndex( std::get<0>( changed ), 0 ), createIndex( std::get<1>( changed ), 0 ) );
endResetModel();
} }
void ChannelModel::addChannelSlot( const QSharedPointer<RocketChatChannel> &channel ) void ChannelModel::addChannelSlot( const QSharedPointer<RocketChatChannel> &channel )
......
...@@ -35,13 +35,9 @@ int SortedVector<T>::insertSort( const QSharedPointer<T> &pointer ) ...@@ -35,13 +35,9 @@ int SortedVector<T>::insertSort( const QSharedPointer<T> &pointer )
return ( *first ) > ( *second ); return ( *first ) > ( *second );
} ); } );
row = std::distance(this->begin(), elementSmallerThanNew); row = std::distance( this->begin(), elementSmallerThanNew );
this->insert( elementSmallerThanNew, pointer ); this->insert( elementSmallerThanNew, pointer );
if(row <0 || row>1000){
qDebug()<<elementSmallerThanNew;
qDebug()<<"error";
}
} }
return row; return row;
...@@ -54,7 +50,7 @@ int SortedVector<T>::findInsertPosition( const QSharedPointer<T> &pointer ) cons ...@@ -54,7 +50,7 @@ int SortedVector<T>::findInsertPosition( const QSharedPointer<T> &pointer ) cons
return ( *first ) < ( *second ); return ( *first ) < ( *second );
} ); } );
return elementSmallerThanNew - this->begin();; return std::distance( this->begin(), elementSmallerThanNew );
} }
...@@ -62,14 +58,39 @@ template<typename T> ...@@ -62,14 +58,39 @@ template<typename T>
int SortedVector<T>::findPosition( const QSharedPointer<T> &pointer ) const int SortedVector<T>::findPosition( const QSharedPointer<T> &pointer ) const
{ {
auto pos = find( this->begin(), this->end(), pointer ); auto pos = find( this->begin(), this->end(), pointer );
return pos - this->begin(); return std::distance( this->begin(), pos );
} }
template<typename T> template<typename T>
void SortedVector<T>::reOrder() std::tuple<int, int> SortedVector<T>::reOrder()
{ {
std::vector<QSharedPointer<T>> indices( this->size() );
for ( const auto &elem : *this ) {
indices.push_back( elem );
}
std::sort( this->begin(), this->end(), [ = ]( const QSharedPointer<T> &first, const QSharedPointer<T> &second )->bool{ std::sort( this->begin(), this->end(), [ = ]( const QSharedPointer<T> &first, const QSharedPointer<T> &second )->bool{
return ( *first ) > ( *second ); return ( *first ) > ( *second );
} ); } );
int from = -1;
int to = -1;
for ( int i = 0; i < this->size() - 1; i++ ) {
if ( indices[i] != ( *this )[i] ) {
from = i;
break;
}
}
for ( int i = this->size() - 1; i >= 0; i-- ) {
if ( indices[i] != ( *this )[i] ) {
to = i;
break;
}
}
return std::make_tuple( from, to );
} }
...@@ -26,9 +26,8 @@ ...@@ -26,9 +26,8 @@
#include <QSharedPointer> #include <QSharedPointer>
#include <QMutex> #include <QMutex>
struct SortedVectorProperties struct SortedVectorProperties {
{ enum class sortOrder {
enum class sortOrder{
asc, asc,
dsc dsc
}; };
...@@ -40,14 +39,14 @@ template<typename T> class SortedVector : public QVector<QSharedPointer<T>> ...@@ -40,14 +39,14 @@ template<typename T> class SortedVector : public QVector<QSharedPointer<T>>
int insertSort( const QSharedPointer<T> & ); int insertSort( const QSharedPointer<T> & );
int findInsertPosition( const QSharedPointer<T> & ) const; int findInsertPosition( const QSharedPointer<T> & ) const;
int findPosition( const QSharedPointer<T> & ) const; int findPosition( const QSharedPointer<T> & ) const;
void reOrder(); std::tuple<int, int> reOrder();
bool operator =( const QVector<QSharedPointer<T>> &o ) bool operator =( const QVector<QSharedPointer<T>> &o )
{ {
this->clear(); this->clear();
this->append( o ); this->append( o );
return true; return true;
} }
private: private:
mutable QMutex mSortMutex; mutable QMutex mSortMutex;
}; };
#include "sortedvector.cpp" #include "sortedvector.cpp"
......
...@@ -83,7 +83,7 @@ const QString &RocketChatChannel::getName() const ...@@ -83,7 +83,7 @@ const QString &RocketChatChannel::getName() const
void RocketChatChannel::setName( const QString &value ) void RocketChatChannel::setName( const QString &value )
{ {
if ( mName != value ) { if ( mName != value && !value.isEmpty() ) {
mName = value; mName = value;
emit dataChanged( mName, "name" ); emit dataChanged( mName, "name" );
} }
...@@ -167,9 +167,11 @@ QList<QSharedPointer<RocketChatMessage>> RocketChatChannel::addMessages( const Q ...@@ -167,9 +167,11 @@ QList<QSharedPointer<RocketChatMessage>> RocketChatChannel::addMessages( const Q
} }
} }
} }
if(newMessages.count()){
if ( newMessages.count() ) {
// emit messageAdded( getRoomId(), 0 ); // emit messageAdded( getRoomId(), 0 );
} }
return newMessages; return newMessages;
} }
...@@ -192,7 +194,8 @@ unsigned int RocketChatChannel::getUnreadMessages() const ...@@ -192,7 +194,8 @@ unsigned int RocketChatChannel::getUnreadMessages() const
void RocketChatChannel::setUnreadMessages( unsigned int value ) void RocketChatChannel::setUnreadMessages( unsigned int value )
{ {
qDebug() << "set unread to: " << value; qDebug() << "set unread to: " << value;
if(mUnreadMessages != value){
if ( mUnreadMessages != value ) {
mUnreadMessages = value; mUnreadMessages = value;
emit unreadMessagesChanged( mRoomId, value ); emit unreadMessagesChanged( mRoomId, value );
} }
...@@ -205,7 +208,7 @@ const QString &RocketChatChannel::getType() const ...@@ -205,7 +208,7 @@ const QString &RocketChatChannel::getType() const
void RocketChatChannel::setType( const QString &pType ) void RocketChatChannel::setType( const QString &pType )
{ {
if ( mType != pType ) { if ( mType != pType && !pType.isEmpty() ) {
mType = pType; mType = pType;
emit dataChanged( mRoomId, "type" ); emit dataChanged( mRoomId, "type" );
} }
...@@ -290,7 +293,7 @@ const QString &RocketChatChannel::getOwnerName() const ...@@ -290,7 +293,7 @@ const QString &RocketChatChannel::getOwnerName() const
void RocketChatChannel::setOwnerName( const QString &pOwner ) void RocketChatChannel::setOwnerName( const QString &pOwner )
{ {
if ( mOwnerName != pOwner ) { if ( mOwnerName != pOwner && !pOwner.isEmpty() ) {
mOwnerName = pOwner; mOwnerName = pOwner;
emit dataChanged( mRoomId, "ownerName" ); emit dataChanged( mRoomId, "ownerName" );
} }
...@@ -303,7 +306,7 @@ const QString &RocketChatChannel::getOwnerId() const ...@@ -303,7 +306,7 @@ const QString &RocketChatChannel::getOwnerId() const
void RocketChatChannel::setOwnerId( const QString &ownerId ) void RocketChatChannel::setOwnerId( const QString &ownerId )
{ {
if ( mOwnerId != ownerId ) { if ( mOwnerId != ownerId && !ownerId.isEmpty() ) {
mOwnerId = ownerId; mOwnerId = ownerId;
emit dataChanged( mRoomId, "ownerId" ); emit dataChanged( mRoomId, "ownerId" );
} }
...@@ -316,7 +319,7 @@ const QString &RocketChatChannel::getUsername() const ...@@ -316,7 +319,7 @@ const QString &RocketChatChannel::getUsername() const
void RocketChatChannel::setUsername( const QString &username ) void RocketChatChannel::setUsername( const QString &username )
{ {
if ( mUsername != username ) { if ( mUsername != username && !username.isEmpty() ) {
mUsername = username; mUsername = username;
emit dataChanged( mRoomId, "username" ); emit dataChanged( mRoomId, "username" );
} }
...@@ -329,7 +332,7 @@ const QSharedPointer<RocketChatUser> &RocketChatChannel::getChatPartner() const ...@@ -329,7 +332,7 @@ const QSharedPointer<RocketChatUser> &RocketChatChannel::getChatPartner() const
void RocketChatChannel::setChatPartner( const QSharedPointer<RocketChatUser> &chatPartner ) void RocketChatChannel::setChatPartner( const QSharedPointer<RocketChatUser> &chatPartner )
{ {
if(mChatPartner != chatPartner){ if ( mChatPartner != chatPartner && !chatPartner.isNull() ) {
mChatPartner = chatPartner; mChatPartner = chatPartner;
connect( chatPartner.data(), &RocketChatUser::statusChanged, this, [ = ]() { connect( chatPartner.data(), &RocketChatUser::statusChanged, this, [ = ]() {
emit dataChanged( mRoomId, "userStatus" ); emit dataChanged( mRoomId, "userStatus" );
...@@ -344,7 +347,7 @@ const QString &RocketChatChannel::getChatPartnerId() const ...@@ -344,7 +347,7 @@ const QString &RocketChatChannel::getChatPartnerId() const
void RocketChatChannel::setChatPartnerId( const QString &chatPartnerId ) void RocketChatChannel::setChatPartnerId( const QString &chatPartnerId )
{ {
if ( mChatPartnerId != chatPartnerId ) { if ( mChatPartnerId != chatPartnerId && !chatPartnerId.isEmpty() ) {
mChatPartnerId = chatPartnerId; mChatPartnerId = chatPartnerId;
// emit dataChanged( mRoomId, "username" ); // emit dataChanged( mRoomId, "username" );
} }
...@@ -357,7 +360,7 @@ QSharedPointer<TempFile> RocketChatChannel::getAvatarImg() const ...@@ -357,7 +360,7 @@ QSharedPointer<TempFile> RocketChatChannel::getAvatarImg() const
void RocketChatChannel::setAvatarImg( const QSharedPointer<TempFile> &pAvatar ) void RocketChatChannel::setAvatarImg( const QSharedPointer<TempFile> &pAvatar )
{ {
if ( mAvatarImg != pAvatar ) { if ( mAvatarImg != pAvatar && !pAvatar.isNull() ) {
mAvatarImg = pAvatar; mAvatarImg = pAvatar;
emit dataChanged( mRoomId, "avatarImg" ); emit dataChanged( mRoomId, "avatarImg" );
} }
...@@ -371,10 +374,11 @@ qint64 RocketChatChannel::getUpdatedAt() const ...@@ -371,10 +374,11 @@ qint64 RocketChatChannel::getUpdatedAt() const
void RocketChatChannel::setUpdatedAt( const qint64 &updatedAt ) void RocketChatChannel::setUpdatedAt( const qint64 &updatedAt )
{ {
//skip signal the first time //skip signal the first time
if(mUpdatedAt != updatedAt && updatedAt != -1){ if ( mUpdatedAt != updatedAt && updatedAt != -1 ) {
if(mUpdatedAt != -1 ){ if ( mUpdatedAt != -1 ) {
emit updatedChanged(mRoomId,updatedAt); emit updatedChanged( mRoomId, updatedAt );
} }
mUpdatedAt = updatedAt; mUpdatedAt = updatedAt;
} }
} }
...@@ -402,34 +406,39 @@ void RocketChatChannel::setBlocked( bool blocked ) ...@@ -402,34 +406,39 @@ void RocketChatChannel::setBlocked( bool blocked )
} }
} }
QStringList RocketChatChannel::whiteList(const QList<QString> ids, const qint64 newest,const qint64 oldest) QStringList RocketChatChannel::whiteList( const QList<QString> ids, const qint64 newest, const qint64 oldest )
{ {
auto idSet = ids.toSet(); auto idSet = ids.toSet();
auto currentList = mMessages.getElements().keys().toSet(); auto currentList = mMessages.getElements().keys().toSet();
auto blacklist = currentList - idSet; auto blacklist = currentList - idSet;
QList<QString> buffer = {}; QList<QString> buffer = {};
std::copy_if (blacklist.begin(), blacklist.end(), std::back_inserter(buffer), std::copy_if( blacklist.begin(), blacklist.end(), std::back_inserter( buffer ),
[=](const QString id){ [ = ]( const QString id ) {
bool keep = true; bool keep = true;
if(mMessages.contains(id) && mMessages.get(id)->getRoomId() == getRoomId()){
auto message = mMessages.get(id); if ( mMessages.contains( id ) && mMessages.get( id )->getRoomId() == getRoomId() ) {
keep = message->inTimeIntervall(newest,oldest); auto message = mMessages.get( id );
keep = message->inTimeIntervall( newest, oldest );
} }
return keep; return keep;
} }
); );
blacklist = buffer.toSet(); blacklist = buffer.toSet();
for(QString id : blacklist){
mMessages.remove(id); for ( QString id : blacklist ) {
mMessages.remove( id );
} }
return blacklist.toList(); return blacklist.toList();
} }
void RocketChatChannel::deleteMessage(const QString id) void RocketChatChannel::deleteMessage( const QString id )
{ {
emit messageDeleted(getRoomId(),id); emit messageDeleted( getRoomId(), id );
if(mMessages.contains(id)){
mMessages.remove(id); if ( mMessages.contains( id ) ) {
mMessages.remove( id );
} }
......
...@@ -110,7 +110,7 @@ void MessageService::persistMessages( const MessageList &pMessage ) ...@@ -110,7 +110,7 @@ void MessageService::persistMessages( const MessageList &pMessage )
void MessageService::persist() void MessageService::persist()
{ {
if(mServer){ if ( mServer ) {
mPersistanceLayer->transaction(); mPersistanceLayer->transaction();
auto channels = mServer->getChannels(); auto channels = mServer->getChannels();
...@@ -133,7 +133,7 @@ void MessageService::persist() ...@@ -133,7 +133,7 @@ void MessageService::persist()
QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObject &pMessageData, QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObject &pMessageData,
bool linkify ) bool linkify )
{ {
if(mServer){ if ( mServer ) {
ChatMessage message( nullptr ); ChatMessage message( nullptr );
QString userId = mServer->getUserId(); QString userId = mServer->getUserId();
bool blocked = false; bool blocked = false;
...@@ -147,7 +147,7 @@ QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObjec ...@@ -147,7 +147,7 @@ QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObjec
msgString = Utils::linkiFy( msgString ); msgString = Utils::linkiFy( msgString );
msgString = msgString.replace( QStringLiteral( "\n" ), QStringLiteral( "<br>" ) ); msgString = msgString.replace( QStringLiteral( "\n" ), QStringLiteral( "<br>" ) );
msgString = Utils::escapeHtml(msgString); msgString = Utils::escapeHtml( msgString );
msgString = Utils::emojiFy( msgString, mEmojiRepo ); msgString = Utils::emojiFy( msgString, mEmojiRepo );
} }
...@@ -222,7 +222,7 @@ QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObjec ...@@ -222,7 +222,7 @@ QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObjec
}; };
auto avatarUrl = "/avatar/" + author + ".jpg"; auto avatarUrl = "/avatar/" + author + ".jpg";
auto avatarRequest = QSharedPointer<FileRequest>::create( avatarUrl, "temp", then, true ); auto avatarRequest = QSharedPointer<FileRequest>::create( avatarUrl, "temp", then, true );
mFileService->getFileRessource( avatarRequest ); //mFileService->getFileRessource( avatarRequest );
message->setAuthor( author ); message->setAuthor( author );
message->setFormattedDate( formattedDate ); message->setFormattedDate( formattedDate );
...@@ -244,7 +244,8 @@ QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObjec ...@@ -244,7 +244,8 @@ QSharedPointer<RocketChatMessage> MessageService::parseMessage( const QJsonObjec
if ( !blocked ) { if ( !blocked ) {
return message; return message;
} }
} }
return nullptr; return nullptr;
} }
...@@ -258,7 +259,7 @@ void MessageService::addUserToBlockList( const QString &pId ) ...@@ -258,7 +259,7 @@ void MessageService::addUserToBlockList( const QString &pId )
void MessageService::addChannelToBlockList( const QString &pId ) void MessageService::addChannelToBlockList( const QString &pId )
{ {
if(mServer){ if ( mServer ) {
QString roomId = pId; QString roomId = pId;
QString userId = mServer->getUserId(); QString userId = mServer->getUserId();
QString otherUserId = roomId.replace( userId, "" ); QString otherUserId = roomId.replace( userId, "" );
...@@ -268,7 +269,7 @@ void MessageService::addChannelToBlockList( const QString &pId ) ...@@ -268,7 +269,7 @@ void MessageService::addChannelToBlockList( const QString &pId )
void MessageService::searchMessage( const QString &pTerm, const QString &pRoom ) void MessageService::searchMessage( const QString &pTerm, const QString &pRoom )
{ {
if(mServer){ if ( mServer ) {
DdpCallback ddpSuccess = [ = ]( const QJsonObject & pResponse, DdpCallback ddpSuccess = [ = ]( const QJsonObject & pResponse,
MeteorDDP * pDdp ) { MeteorDDP * pDdp ) {
Q_UNUSED( pDdp ) Q_UNUSED( pDdp )
...@@ -301,7 +302,7 @@ void MessageService::searchMessage( const QString &pTerm, const QString &pRoom ) ...@@ -301,7 +302,7 @@ void MessageService::searchMessage( const QString &pTerm, const QString &pRoom )
void MessageService::loadHistoryFromServer( const QSharedPointer<LoadHistoryRequestContainer> &pContainer ) void MessageService::loadHistoryFromServer( const QSharedPointer<LoadHistoryRequestContainer> &pContainer )
{ {
if ( !pContainer.isNull()&&mServer ) { if ( !pContainer.isNull() && mServer ) {
auto requests = pContainer->getRequests(); auto requests = pContainer->getRequests();
pContainer->mAlredayReceived = 0; pContainer->mAlredayReceived = 0;
...@@ -349,7 +350,7 @@ void MessageService::loadHistoryFromServer( const QSharedPointer<LoadHistoryRequ ...@@ -349,7 +350,7 @@ void MessageService::loadHistoryFromServer( const QSharedPointer<LoadHistoryRequ
auto messageObject = parseMessage( currentMessage.toObject(), true ); auto messageObject = parseMessage( currentMessage.toObject(), true );
if ( !messageObject.isNull() && !duplicateCheck->contains( messageObject->getId() )) {