Skip to content
Snippets Groups Projects

Design

Merged Armin Felder requested to merge design into master
1 file
+ 0
1
Compare changes
  • Side-by-side
  • Inline
+ 10
20
@@ -41,8 +41,6 @@
/**
* @brief RocketChat::RocketChat
* @param restApi
* @param ddp
*/
RocketChat::RocketChat( QGuiApplication *app )
{
@@ -62,7 +60,6 @@ RocketChat::RocketChat( QGuiApplication *app )
qRegisterMetaType<ConnectionState>( "ConnectionState" );
qRegisterMetaType<Qt::ApplicationState>( "Qt::ApplicationState" );
}
RocketChat::~RocketChat()
@@ -106,8 +103,6 @@ void RocketChat::login( const QString &pServerId, const QString &pUsername, cons
mStorage->wipeDb();
}
qDebug() << "login thread id: " << QThread::currentThreadId();
if ( mServerStatus ) {
QMetaObject::invokeMethod( mServerMap.first(), "login", Q_ARG( QString, pUsername ), Q_ARG( QString, pPassword ) );
}
@@ -266,6 +261,11 @@ void RocketChat::searchRoomByType( const QString &pTerm, const QString &pType )
QMetaObject::invokeMethod( mServerMap.first(), "searchRoom", Q_ARG( QString, pTerm ), Q_ARG( QString, pType ) );
}
void RocketChat::setUserDefaultStatus( int pStatus )
{
QMetaObject::invokeMethod( mServerMap.first(), "setUserPresenceDefaultStatus", Q_ARG( int, pStatus ) );
}
bool RocketChat::newServerByDomain( const QString &domain, bool pUnsecure = false )
{
newServerMutex.lock();
@@ -316,17 +316,6 @@ bool RocketChat::newServerByDomain( const QString &domain, bool pUnsecure = fals
return 0;
}
//TODO: make asynchonous
void RocketChat::getUserOfChannel( const QString &pServerId, const QString &pChannelId )
{
Q_UNUSED( pServerId );
if ( mServerStatus ) {
QMetaObject::invokeMethod( mServerMap.first(), "requestUsersOfChannel", Q_ARG( QString, pChannelId ) );
}
}
void RocketChat::openPrivateChannelWith( const QString &pServerId, const QString &pUsername )
{
Q_UNUSED( pServerId );
@@ -614,12 +603,12 @@ void RocketChat::logout( const QString &pServerId )
}
}
void RocketChat::createChannel( const QString &pServerId, const QString &pChannelName, const QStringList &pUsersNames, bool pReadonly )
void RocketChat::createPublicGroup( const QString &pServerId, const QString &pChannelName, const QStringList &pUsersNames, bool pReadonly )
{
Q_UNUSED( pServerId );
if ( mServerStatus ) {
QMetaObject::invokeMethod( mServerMap.first(), "createChannel", Q_ARG( QString, pChannelName ), Q_ARG( QStringList, pUsersNames ), Q_ARG( bool, pReadonly ) );
QMetaObject::invokeMethod( mServerMap.first(), "createPublicGroup", Q_ARG( QString, pChannelName ), Q_ARG( QStringList, pUsersNames ), Q_ARG( bool, pReadonly ) );
}
}
@@ -762,7 +751,6 @@ void RocketChat::serverReadySlot()
connect( pServer, &RocketChatServerData::openUrl, this, &RocketChat::openUrl, Qt::UniqueConnection );
connect( pServer, &RocketChatServerData::usersReady, this, &RocketChat::channelUsersReady, Qt::UniqueConnection );
connect( pServer, &RocketChatServerData::channelDetailsReady, this, &RocketChat::channelDetailsReady, Qt::UniqueConnection );
connect( pServer, &RocketChatServerData::unreadCountChanged, this, &RocketChat::onUnreadCountChanged, Qt::UniqueConnection );
@@ -774,8 +762,9 @@ void RocketChat::serverReadySlot()
connect( pServer, &RocketChatServerData::loggingIn, this, &RocketChat::loggingIn, Qt::UniqueConnection );
connect( pServer, &RocketChatServerData::historyReady, this, &RocketChat::historyReady, Qt::UniqueConnection );
QMetaObject::invokeMethod( pServer, "init" );
connect( pServer, &RocketChatServerData::userStatusChanged, this, &RocketChat::userStatusChanged, Qt::UniqueConnection );
QMetaObject::invokeMethod( pServer, "init" );
}
void RocketChat::storageReadySlot()
@@ -846,6 +835,7 @@ void RocketChat::onServerSlotsReady()
#ifdef Q_OS_ANDROID
connect( &mNotificationsObject, &Notifications::tokenReceived, firstServer, &RocketChatServerData::sendPushToken, Qt::UniqueConnection );
connect( &mNotificationsObject, &Notifications::messageReceived, firstServer, &RocketChatServerData::switchChannel, Qt::UniqueConnection );
#endif
#ifdef Q_OS_IOS
connect( this, &RocketChat::pushTokenReceived, firstServer, &RocketChatServerData::sendPushToken, Qt::UniqueConnection );
Loading