Early out parsing if we're only processing incoming OR outgoing.
[qwerkisync] / EventParsers / VMGEntities / VMessage.cpp
index 75ace8f..443070e 100644 (file)
@@ -89,6 +89,14 @@ bool VMessage::Read(const QString &initialLine, QTextStream &stream, EventTypes:
                {
                        QString box = lineData.mid(lineData.indexOf(":") + 1);
                        bool isOutgoing(box == "SENT");
+
+                       // Early out once we know we're not processing this type of message
+                       if((!isOutgoing && !CurrentSettings().ShouldProcess(Settings::INCOMING, EventTypes::EVENT_TYPE_SMS))
+                               || isOutgoing && !CurrentSettings().ShouldProcess(Settings::OUTGOING, EventTypes::EVENT_TYPE_SMS))
+                       {
+                               return false;
+                       }
+
                        if (isOutgoing == false && box != "INBOX")
                        {
                                qDebug() << "Unexpected box: " << box;