...
 
Commits (4)
......@@ -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" ) ) {
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;
}
......@@ -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::dataChanged, this, &ChannelModel::onDataChanged, 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() );
int pos = channelList.findPosition( channel );
if(pos <0){
if ( pos < 0 ) {
pos = 0;
}
beginInsertRows( QModelIndex(), pos, pos );
channelList.insertSort( channel );
endInsertRows();
......@@ -165,35 +168,38 @@ bool ChannelModel::addChannel( const QSharedPointer<RocketChatChannel> &channel
}
bool ChannelModel::addChannelsSlot(const QVector<QSharedPointer<RocketChatChannel> > &pChannels)
bool ChannelModel::addChannelsSlot( const QList<QSharedPointer<RocketChatChannel> > &pChannels )
{
// beginResetModel();
int from =-1;
// beginResetModel();
int from = -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::unreadMessagesChanged, this, &ChannelModel::onUnreadMessageChanged, 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::updatedChanged, this, &ChannelModel::onChannelOrderChanged);
connect( channel.data(), &RocketChatChannel::updatedChanged, this, &ChannelModel::onChannelOrderChanged );
duplicateCheck.insert( channel->getRoomId() );
auto index = channelList.insertSort( channel );
if(from == -1){
if ( from == -1 ) {
from = index;
to = index;
}
if(index<from){
if ( index < from ) {
from = index;
}else if(index>to){
} else if ( index > to ) {
to = index;
}
}
}
beginInsertRows( QModelIndex(), from, to );
endInsertRows();
// endResetModel();
// endResetModel();
return true;
}
......@@ -237,7 +243,7 @@ void ChannelModel::onNewerMessage( const QString &id, qint64 timestamp )
//emit dataChanged(index(pos),index(pos),{lastMessageText});
}
// sortChanged();
// sortChanged();
}
void ChannelModel::onUnreadMessageChanged( const QString &id, int number )
......@@ -293,29 +299,30 @@ void ChannelModel::onDeleted( const QString &pId, bool deleted )
Q_UNUSED( deleted )
int idx = -1;
for ( int i = 0; i < channelList.length(); i++ ) {
if ( channelList.at( i )->getRoomId() == pId ) {
idx = i;
auto iter = channelList.begin();
for ( ; iter != channelList.end(); iter++ ) {
if ( ( *iter )->getRoomId() == pId ) {
break;
}
}
if ( idx != -1 ) {
if ( iter != channelList.end() ) {
idx = static_cast<int>( std::distance( channelList.begin(), iter ) );
beginRemoveRows( QModelIndex(), idx, idx );
channelList.remove( idx );
channelList.erase( iter );
endRemoveRows();
}
}
void ChannelModel::onChannelOrderChanged(const QString &pId, qint64 pTimestamp)
void ChannelModel::onChannelOrderChanged( const QString &pId, qint64 pTimestamp )
{
static int counter = 0;
counter++;
qDebug() << counter;
beginResetModel();
channelList.reOrder();
endResetModel();
static int counter = 0;
counter++;
qDebug() << counter;
auto changed = channelList.reOrder();
emit dataChanged( createIndex( std::get<0>( changed ), 0 ), createIndex( std::get<1>( changed ), 0 ) );
}
void ChannelModel::addChannelSlot( const QSharedPointer<RocketChatChannel> &channel )
......
......@@ -72,7 +72,7 @@ class ChannelModel : public QAbstractListModel
void onUnreadMessageChanged( const QString &id, int number );
void onDataChanged( const QString &id, const QString &property );
void onDeleted( const QString &pId, bool deleted );
void onChannelOrderChanged(const QString &pId, qint64 pTimestamp);
void onChannelOrderChanged( const QString &pId, qint64 pTimestamp );
QTimer timer;
signals:
......@@ -80,8 +80,8 @@ class ChannelModel : public QAbstractListModel
void unreadMessagesChanged( void );
public slots:
void addChannelSlot(const QSharedPointer<RocketChatChannel> &);
bool addChannelsSlot( const QVector<QSharedPointer<RocketChatChannel>> & );
void addChannelSlot( const QSharedPointer<RocketChatChannel> & );
bool addChannelsSlot( const QList<QSharedPointer<RocketChatChannel>> & );
};
......
......@@ -6,7 +6,7 @@
#include "repos/entities/rocketchatchannel.h"
#include "container/sortedvector.h"
typedef QVector<QSharedPointer<RocketChatChannel>> channelVector;
typedef QList<QSharedPointer<RocketChatChannel>> channelVector;
class RoomSearchResultsModel: public QAbstractListModel
{
......
......@@ -35,13 +35,9 @@ int SortedVector<T>::insertSort( const QSharedPointer<T> &pointer )
return ( *first ) > ( *second );
} );
row = std::distance(this->begin(), elementSmallerThanNew);
row = std::distance( this->begin(), elementSmallerThanNew );
this->insert( elementSmallerThanNew, pointer );
if(row <0 || row>1000){
qDebug()<<elementSmallerThanNew;
qDebug()<<"error";
}
}
return row;
......@@ -54,7 +50,7 @@ int SortedVector<T>::findInsertPosition( const QSharedPointer<T> &pointer ) cons
return ( *first ) < ( *second );
} );
return elementSmallerThanNew - this->begin();;
return std::distance( this->begin(), elementSmallerThanNew );
}
......@@ -62,14 +58,39 @@ template<typename T>
int SortedVector<T>::findPosition( const QSharedPointer<T> &pointer ) const
{
auto pos = find( this->begin(), this->end(), pointer );
return pos - this->begin();
return std::distance( this->begin(), pos );
}
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{
return ( *first ) > ( *second );
} );
int from = -1;
int to = -1;
for ( int i = 0; i < this->size() ; 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,28 +26,27 @@
#include <QSharedPointer>
#include <QMutex>
struct SortedVectorProperties
{
enum class sortOrder{
struct SortedVectorProperties {
enum class sortOrder {
asc,
dsc
};
};
template<typename T> class SortedVector : public QVector<QSharedPointer<T>>
template<typename T> class SortedVector : public QList<QSharedPointer<T>>
{
public:
int insertSort( const QSharedPointer<T> & );
int findInsertPosition( const QSharedPointer<T> & ) const;
int findPosition( const QSharedPointer<T> & ) const;
void reOrder();
std::tuple<int, int> reOrder();
bool operator =( const QVector<QSharedPointer<T>> &o )
{
this->clear();
this->append( o );
return true;
}
private:
private:
mutable QMutex mSortMutex;
};
#include "sortedvector.cpp"
......
......@@ -59,10 +59,10 @@ bool ChannelRepository::add( const QSharedPointer<RocketChatChannel> &pChannel )
return add( id, pChannel );
}
bool ChannelRepository::add(const QString &pType, const QVector<QSharedPointer<RocketChatChannel> > &pChannels)
bool ChannelRepository::add( const QString &pType, const QList<QSharedPointer<RocketChatChannel> > &pChannels )
{
if(!pChannels.empty()){
for(const auto &elem: pChannels){
if ( !pChannels.empty() ) {
for ( const auto &elem : pChannels ) {
if ( !mElements.contains( elem->getRoomId() ) ) {
mNameIndex[elem->getName()] = elem;
......@@ -71,13 +71,15 @@ bool ChannelRepository::add(const QString &pType, const QVector<QSharedPointer<R
}
}
}
if(pType == "p"){
auto result = QMetaObject::invokeMethod( mGroupsModel, "addChannelsSlot", Q_ARG( QVector<QSharedPointer<RocketChatChannel> >, pChannels) );
}else if(pType == "c"){
auto result = QMetaObject::invokeMethod( mChannelsModel, "addChannelsSlot", Q_ARG( QVector<QSharedPointer<RocketChatChannel> >, pChannels ) );
}else if(pType == "d"){
auto result = QMetaObject::invokeMethod( mDirectModel, "addChannelsSlot", Q_ARG( QVector<QSharedPointer<RocketChatChannel> >, pChannels ) );
if ( pType == "p" ) {
auto result = QMetaObject::invokeMethod( mGroupsModel, "addChannelsSlot", Q_ARG( QList<QSharedPointer<RocketChatChannel> >, pChannels ) );
} else if ( pType == "c" ) {
auto result = QMetaObject::invokeMethod( mChannelsModel, "addChannelsSlot", Q_ARG( QList<QSharedPointer<RocketChatChannel> >, pChannels ) );
} else if ( pType == "d" ) {
auto result = QMetaObject::invokeMethod( mDirectModel, "addChannelsSlot", Q_ARG( QList<QSharedPointer<RocketChatChannel> >, pChannels ) );
}
return true;
}
......
......@@ -42,7 +42,7 @@ class ChannelRepository : public QObject, public AbstractBaseRepository<RocketCh
explicit ChannelRepository( QObject *parent = nullptr );
bool add( const QString &id, const QSharedPointer<RocketChatChannel> & );
bool add( const QSharedPointer<RocketChatChannel> &pChannel );
bool add(const QString &pType, const QVector<QSharedPointer<RocketChatChannel>> &pChannels);
bool add( const QString &pType, const QList<QSharedPointer<RocketChatChannel>> &pChannels );
QSharedPointer<RocketChatChannel> getChannelByName( const QString &pName );
const QSharedPointer<RocketChatChannel> getChannelByName( const QString &pName ) const;
......
......@@ -83,7 +83,7 @@ const QString &RocketChatChannel::getName() const
void RocketChatChannel::setName( const QString &value )
{
if ( mName != value ) {
if ( mName != value && !value.isEmpty() ) {
mName = value;
emit dataChanged( mName, "name" );
}
......@@ -167,9 +167,11 @@ QList<QSharedPointer<RocketChatMessage>> RocketChatChannel::addMessages( const Q
}
}
}
if(newMessages.count()){
// emit messageAdded( getRoomId(), 0 );
if ( newMessages.count() ) {
// emit messageAdded( getRoomId(), 0 );
}
return newMessages;
}
......@@ -192,7 +194,8 @@ unsigned int RocketChatChannel::getUnreadMessages() const
void RocketChatChannel::setUnreadMessages( unsigned int value )
{
qDebug() << "set unread to: " << value;
if(mUnreadMessages != value){
if ( mUnreadMessages != value ) {
mUnreadMessages = value;
emit unreadMessagesChanged( mRoomId, value );
}
......@@ -205,7 +208,7 @@ const QString &RocketChatChannel::getType() const
void RocketChatChannel::setType( const QString &pType )
{
if ( mType != pType ) {
if ( mType != pType && !pType.isEmpty() ) {
mType = pType;
emit dataChanged( mRoomId, "type" );
}
......@@ -290,7 +293,7 @@ const QString &RocketChatChannel::getOwnerName() const
void RocketChatChannel::setOwnerName( const QString &pOwner )
{
if ( mOwnerName != pOwner ) {
if ( mOwnerName != pOwner && !pOwner.isEmpty() ) {
mOwnerName = pOwner;
emit dataChanged( mRoomId, "ownerName" );
}
......@@ -303,7 +306,7 @@ const QString &RocketChatChannel::getOwnerId() const
void RocketChatChannel::setOwnerId( const QString &ownerId )
{
if ( mOwnerId != ownerId ) {
if ( mOwnerId != ownerId && !ownerId.isEmpty() ) {
mOwnerId = ownerId;
emit dataChanged( mRoomId, "ownerId" );
}
......@@ -316,7 +319,7 @@ const QString &RocketChatChannel::getUsername() const
void RocketChatChannel::setUsername( const QString &username )
{
if ( mUsername != username ) {
if ( mUsername != username && !username.isEmpty() ) {
mUsername = username;
emit dataChanged( mRoomId, "username" );
}
......@@ -329,7 +332,7 @@ const QSharedPointer<RocketChatUser> &RocketChatChannel::getChatPartner() const
void RocketChatChannel::setChatPartner( const QSharedPointer<RocketChatUser> &chatPartner )
{
if(mChatPartner != chatPartner){
if ( mChatPartner != chatPartner && !chatPartner.isNull() ) {
mChatPartner = chatPartner;
connect( chatPartner.data(), &RocketChatUser::statusChanged, this, [ = ]() {
emit dataChanged( mRoomId, "userStatus" );
......@@ -344,7 +347,7 @@ const QString &RocketChatChannel::getChatPartnerId() const
void RocketChatChannel::setChatPartnerId( const QString &chatPartnerId )
{
if ( mChatPartnerId != chatPartnerId ) {
if ( mChatPartnerId != chatPartnerId && !chatPartnerId.isEmpty() ) {
mChatPartnerId = chatPartnerId;
// emit dataChanged( mRoomId, "username" );
}
......@@ -352,12 +355,16 @@ void RocketChatChannel::setChatPartnerId( const QString &chatPartnerId )
QSharedPointer<TempFile> RocketChatChannel::getAvatarImg() const
{
if ( mAvatarImg.isNull() ) {
}
return mAvatarImg;
}
void RocketChatChannel::setAvatarImg( const QSharedPointer<TempFile> &pAvatar )
{
if ( mAvatarImg != pAvatar ) {
if ( mAvatarImg != pAvatar && !pAvatar.isNull() ) {
mAvatarImg = pAvatar;
emit dataChanged( mRoomId, "avatarImg" );
}
......@@ -371,10 +378,11 @@ qint64 RocketChatChannel::getUpdatedAt() const
void RocketChatChannel::setUpdatedAt( const qint64 &updatedAt )
{
//skip signal the first time
if(mUpdatedAt != updatedAt && updatedAt != -1){
if(mUpdatedAt != -1 ){
emit updatedChanged(mRoomId,updatedAt);
if ( mUpdatedAt != updatedAt && updatedAt != -1 ) {
if ( mUpdatedAt != -1 ) {
emit updatedChanged( mRoomId, updatedAt );
}
mUpdatedAt = updatedAt;
}
}
......@@ -386,7 +394,7 @@ qint64 RocketChatChannel::getCreatedAt() const
void RocketChatChannel::setCreatedAt( const qint64 &createdAt )
{
mCreatedAt = createdAt;
mCreatedAt = createdAt;
}
bool RocketChatChannel::getBlocked() const
......@@ -402,34 +410,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 currentList = mMessages.getElements().keys().toSet();
auto blacklist = currentList - idSet;
QList<QString> buffer = {};
std::copy_if (blacklist.begin(), blacklist.end(), std::back_inserter(buffer),
[=](const QString id){
std::copy_if( blacklist.begin(), blacklist.end(), std::back_inserter( buffer ),
[ = ]( const QString id ) {
bool keep = true;
if(mMessages.contains(id) && mMessages.get(id)->getRoomId() == getRoomId()){
auto message = mMessages.get(id);
keep = message->inTimeIntervall(newest,oldest);
if ( mMessages.contains( id ) && mMessages.get( id )->getRoomId() == getRoomId() ) {
auto message = mMessages.get( id );
keep = message->inTimeIntervall( newest, oldest );
}
return keep;
}
);
);
blacklist = buffer.toSet();
for(QString id : blacklist){
mMessages.remove(id);
for ( QString id : blacklist ) {
mMessages.remove( id );
}
return blacklist.toList();
}
void RocketChatChannel::deleteMessage(const QString id)
void RocketChatChannel::deleteMessage( const QString id )
{
emit messageDeleted(getRoomId(),id);
if(mMessages.contains(id)){
mMessages.remove(id);
emit messageDeleted( getRoomId(), id );
if ( mMessages.contains( id ) ) {
mMessages.remove( id );
}
......
......@@ -198,7 +198,7 @@ void RocketChatMessage::setRoomeTyp( const QString &value )
roomeTyp = value;
}
bool RocketChatMessage::inTimeIntervall(const qint64 newt,const qint64 oldt)
bool RocketChatMessage::inTimeIntervall( const qint64 newt, const qint64 oldt )
{
return getTimestamp() >= oldt && getTimestamp() <= newt;
}
......@@ -210,8 +210,13 @@ QSharedPointer<TempFile> RocketChatMessage::getAvatarImg() const
void RocketChatMessage::setAvatarImg( const QSharedPointer<TempFile> &avatarImg )
{
if ( mAvatarImg != avatarImg ) {
if ( mAvatarImg != avatarImg && !avatarImg.isNull() ) {
mAvatarImg = avatarImg;
emit dataChanged( id, "avatarImg" );
if ( mIntialized ) {
emit dataChanged( id, "avatarImg" );
}
mIntialized = true;
}
}
......@@ -94,11 +94,12 @@ class RocketChatMessage: public QObject
const QString &getRoomeTyp() const;
void setRoomeTyp( const QString &value );
bool inTimeIntervall(const qint64 newt,const qint64 oldt);
bool inTimeIntervall( const qint64 newt, const qint64 oldt );
QSharedPointer<TempFile> getAvatarImg() const;
void setAvatarImg( const QSharedPointer<TempFile> &avatarImg );
protected:
bool mIntialized = false;
QSharedPointer<TempFile> mAvatarImg;
QSharedPointer<RocketChatUser> mAuthor;
bool empty = false;
......
......@@ -57,7 +57,7 @@ void RocketChatServerData::init()
void RocketChatServerData::initDb()
{
qDebug()<<" "<<QThread::currentThreadId();
qDebug() << " " << QThread::currentThreadId();
mStorage = PersistanceLayer::instance();
connect( mStorage, &PersistanceLayer::ready, this, &RocketChatServerData::initConnections, Qt::UniqueConnection );
......@@ -66,7 +66,7 @@ void RocketChatServerData::initDb()
void RocketChatServerData::initConnections()
{
qDebug()<<" "<<QThread::currentThreadId();
qDebug() << " " << QThread::currentThreadId();
historyLoaded = [ = ]( QMultiMap<QString, QSharedPointer<RocketChatMessage>> *messages ) {
if ( messages ) {
......@@ -503,9 +503,10 @@ QString RocketChatServerData::getUserId() const
void RocketChatServerData::setUserId( const QString &userId )
{
//TODO: do this differently
auto users = Models::getUsersModel();
if(users){
qDebug()<<" "<<QThread::currentThreadId();
auto users = Models::getUsersModel();
if ( users ) {
qDebug() << " " << QThread::currentThreadId();
users->mMutex.lock();
auto user = users->getUserById( userId );
......@@ -522,6 +523,7 @@ void RocketChatServerData::setUserId( const QString &userId )
emit userStatusChanged( static_cast<int>( user->getStatus() ) );
} );
}
users->mMutex.unlock();
}
......@@ -599,11 +601,12 @@ void RocketChatServerData::onUnreadCountChanged()
number += channel->getUnreadMessages();
}
}
if ( lastUnreadCount != number ) {
lastUnreadCount = number;
emit unreadCountChanged( QStringLiteral( "default" ), number );
}
if ( lastUnreadCount != number ) {
lastUnreadCount = number;
emit unreadCountChanged( QStringLiteral( "default" ), number );
}
}
......@@ -1180,10 +1183,10 @@ void RocketChatServerData::handleChannelMessage( const QJsonObject &pMessage )
qint64 updatedAt = -1;
if ( data.contains( "_updatedAt" ) ) {
/*if ( data.contains( "_updatedAt" ) ) {
auto updatedObj = data["_updatedAt"].toObject();
updatedAt = static_cast<qint64>( updatedObj["$date"].toDouble() );
}
}*/
auto type = data[QStringLiteral( "t" )].toString();
bool blocked = false;
......@@ -1438,6 +1441,7 @@ void RocketChatServerData::onDDPMessageReceived( const QJsonObject &pMessage )
auto result = QMetaObject::invokeMethod( userModel, "addUser", Q_ARG( User, newUser ) );
Q_ASSERT( result );
}
userModel->mMutex.unlock();
......@@ -1534,6 +1538,11 @@ void RocketChatServerData::handleStreamRoomMessage( const QJsonObject &pMessage
mChannels->get( roomId )->addMessage( message );
mMessageService->persistMessage( message );
//TODO: fix RC server to make this hack unnecessary
if ( channel->getUpdatedAt() < message->getTimestamp() ) {
channel->setUpdatedAt( message->getTimestamp() );
}
if ( message->getMessageType() == "au" ) {
mChannelService->loadUsersOfChannel( channel );
}
......@@ -1714,7 +1723,7 @@ void RocketChatServerData::getServerSettings()
sendDdprequest( request, true, true );
}
void RocketChatServerData::onChannelsLoaded( const QVector<QSharedPointer<RocketChatChannel>> &pChannels )
void RocketChatServerData::onChannelsLoaded( const QList<QSharedPointer<RocketChatChannel>> &pChannels )
{
Q_UNUSED( pChannels );
qDebug() << "on channels loaded ";
......
......@@ -217,7 +217,7 @@ class RocketChatServerData : public MessageListener
void setSetting( const QString &pKey, const QString &pValue );
void getSetting( const QString &pKey );
void deleteMessage(QString rid, QString id);
void deleteMessage( QString rid, QString id );
void reconnect();
public:
......@@ -298,7 +298,7 @@ class RocketChatServerData : public MessageListener
void onDDPAuthenticated();
void onDDPMessageReceived( const QJsonObject &pMessage );
void onChannelsLoaded( const QVector<QSharedPointer<RocketChatChannel> > &pChannels );
void onChannelsLoaded( const QList<QSharedPointer<RocketChatChannel> > &pChannels );
void onLoggedIn();
bool isStreamRoomMessage( const QJsonObject &pMessage ) const;
bool isUserJoinMessage( const QJsonObject &pMessage ) const;
......@@ -341,7 +341,7 @@ class RocketChatServerData : public MessageListener
void userStatusChanged( int status );
void videoPath( const QString &path );
void setting( const QString &pKey, const QString &pValue );
void offline(void);
void offline( void );
// MessageListener interface
public:
......
This diff is collapsed.
This diff is collapsed.
......@@ -19,6 +19,7 @@
********************************************************************************************/
#pragma once
#ifndef ROCKETCHATCHANNELFACTORY_H
#define ROCKETCHATCHANNELFACTORY_H
......@@ -44,7 +45,7 @@
#include "CustomModels/models.h"
typedef QVector<QSharedPointer<RocketChatChannel>> channelVector;
typedef QList<QSharedPointer<RocketChatChannel>> channelVector;
typedef QVector<QSharedPointer<RocketChatUser>> userVector;
......@@ -106,7 +107,7 @@ class RocketChatChannelService : public QObject
FileService *mFileService = nullptr;
MeteorDDP *mDdp;
QVector<QSharedPointer<RocketChatChannel>> processChannelData( const QJsonArray &pChannelArray, bool pJoined, bool pUpdateOnly );
QList<QSharedPointer<RocketChatChannel>> processChannelData( const QJsonArray &pChannelArray, bool pJoined, bool pUpdateOnly );
MessageService *mMessageService;
signals:
......