Skip to content
Snippets Groups Projects
Commit 967a8364 authored by Armin Felder's avatar Armin Felder
Browse files

fix message insert

parent ae908aa2
Branches removeexecutionPolicy
No related tags found
1 merge request!123Fix message insert
......@@ -170,7 +170,7 @@ bool ChannelModel::addChannelsSlot(const QVector<QSharedPointer<RocketChatChanne
beginResetModel();
for(const auto &channel: pChannels){
if ( !channel.isNull() && channel->getRoomId() != "" && !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::dataChanged, this, &ChannelModel::onDataChanged, Qt::UniqueConnection );
connect( channel.data(), &RocketChatChannel::channelDeleted, this, &ChannelModel::onDeleted, Qt::UniqueConnection );
......
......@@ -45,14 +45,12 @@ int SortedVector<T>::insertSort( const QSharedPointer<T> &pointer )
template<typename T>
int SortedVector<T>::findInsertPosition( const QSharedPointer<T> &pointer ) const
{
int row = -1;
auto elementSmallerThanNew = std::lower_bound( this->begin(), this->end(), pointer, []( const QSharedPointer<T> &first, const QSharedPointer<T> &second )->bool{
return ( *first ) > ( *second );
return ( *first ) < ( *second );
} );
row = elementSmallerThanNew - this->begin();
return elementSmallerThanNew - this->begin();;
return row;
}
template<typename T>
......
TEMPLATE = lib
QT += core network websockets sql concurrent
CONFIG += c++17 static
CONFIG += c++14 static
SOURCES += api/meteorddp.cpp \
api/restapi.cpp \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment