Commit c1f0fa7b authored by armin's avatar armin
Browse files

asd

parent 01713517
......@@ -38,6 +38,7 @@ QVariant ChannelModel::data( const QModelIndex &index, int role ) const
auto currentChannel = channelList.at( row );
if ( !currentChannel.isNull() ) {
auto roleType = static_cast<ChannelRoles>( role );
switch ( roleType ) {
......@@ -136,6 +137,7 @@ QVariant ChannelModel::data( const QModelIndex &index, int role ) const
}
}
}
return QVariant();
......@@ -174,6 +176,8 @@ bool ChannelModel::addChannelsSlot( const QList<QSharedPointer<RocketChatChannel
int from = -1;
int to = -1;
beginResetModel();
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 );
......@@ -197,9 +201,9 @@ bool ChannelModel::addChannelsSlot( const QList<QSharedPointer<RocketChatChannel
}
}
beginInsertRows( QModelIndex(), from, to );
endInsertRows();
// endResetModel();
//beginInsertRows( QModelIndex(), from, to );
//endInsertRows();
endResetModel();
return true;
}
......
......@@ -113,7 +113,7 @@ QList<QSharedPointer<RocketChatChannel> > RocketChatChannelService::processChann
qint64 updatedAt = -1;
//don't ask ...
if ( currentChannelObject.contains( QStringLiteral( "_updatedAt" ) ) ) {
if ( currentChannelObject.contains( QStringLiteral( "_updatedAt" ) ) && !currentChannelObject.contains( QStringLiteral( "ls" ) ) ) {
auto updatedObj = currentChannelObject[QStringLiteral( "_updatedAt" )].toObject();
updatedAt = static_cast<qint64>( updatedObj[QStringLiteral( "$date" )].toDouble() );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment