Add sanity check to dbus-exposed requestConversation()
This commit is contained in:
parent
3eb2f67d38
commit
c18c7b27f1
1 changed files with 10 additions and 0 deletions
|
@ -91,6 +91,16 @@ QVariantList ConversationsDbusInterface::activeConversations()
|
|||
|
||||
void ConversationsDbusInterface::requestConversation(const qint64& conversationID, int start, int end)
|
||||
{
|
||||
if (start < 0 || end < 0) {
|
||||
qCWarning(KDECONNECT_CONVERSATIONS) << "requestConversation" << "Start and end must be >= 0";
|
||||
return;
|
||||
}
|
||||
|
||||
if (end - start < 0) {
|
||||
qCWarning(KDECONNECT_CONVERSATIONS) << "requestConversation" <<"Start must be before end";
|
||||
return;
|
||||
}
|
||||
|
||||
RequestConversationWorker* worker = new RequestConversationWorker(conversationID, start, end, this);
|
||||
connect(worker, &RequestConversationWorker::conversationMessageRead,
|
||||
this, &ConversationsDbusInterface::conversationUpdated,
|
||||
|
|
Loading…
Reference in a new issue