Commit 9c0c0416 authored by Dennis's avatar Dennis
Browse files

Merge branch '142-creation-of-rooms-not-working-properly' into 'master'

added error when room cannot be created

See merge request !107
parents ecd665ab 8c2efd6e
......@@ -2040,7 +2040,19 @@ void RocketChatServerData::createPublicGroup( const QString &pChannelName, const
}
}
};
auto request = QSharedPointer<RocketChatCreatePublicGroupRequest>::create( pChannelName, pUsers, pReadonly );
DdpCallback errorFunc = [ = ]( QJsonObject object, MeteorDDP * ) {
QString reason;
QJsonObject errorObject = object["error"].toObject();
if(errorObject.contains("reason")){
if(errorObject.contains("reason")){
reason = errorObject["reason"].toString();
}
}
emit error(tr("Room creation failed. ")+reason);
return;
};
auto request = QSharedPointer<RocketChatCreatePublicGroupRequest>::create( pChannelName, pUsers, pReadonly,success );
request->setError(errorFunc);
sendDdprequest( request );
}
......
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