I implemented a query for chat messages in PARSE using their REST API. My problem is, I am getting messages where somehow sender and receiver was the same.
Clearly a bug or a test in the debug version. Anyway, those messages should not get displayed.
Obviously I want to fix that by changing my PARSE Query and not go through all the messages and delete the wrong ones. Is that even possible? I am not very good with the PARSE REST API.
This is what I am passing to PARSE API:
$aWhere = array(
self::FIELD_SENDER => array('$in' => array($sUsername1, $sUsername2)),
self::FIELD_RECEIVER => array('$in' => array($sUsername1, $sUsername2)),
);
$url = 'https://api.parse.com/1/classes/test?where='.json_encode($aWhere);
url then gets passed into CURL
I want to avoid messages where self::FIELD_SENDER is $sUsername1 AND self::FIELD_RECEIVER is $sUsername1 and the same goes in respect to $sUsername2.