-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsee.php
More file actions
44 lines (32 loc) · 1.16 KB
/
see.php
File metadata and controls
44 lines (32 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?
// Cryptoblog Chat Friendship Killer Utility
// Copyleft by Elemential 2015
// Licensed under LGPL 3.0
//Nobody expects the Illuminati
require_once("config.php");
require_once("verify.php");
require_once("message.php");
header("Content-type: application/json");
$return_value = [ "valid" => false ];
$con = CryptoblogConfig::getConnection();
$inputMessage = new CryptoblogMessage($_REQUEST['data'], $_REQUEST['peerid'], CryptoblogMessage::ENCRYPTED);
if( $inputMessage -> getValid() )
{
$data = $inputMessage -> getMessage();
$query = sprintf(
"UPDATE %1\$s
SET seen = TRUE
WHERE recipient = %2\$d
AND id = %3\$d
",
CryptoblogConfig::getTableName("negotiations"),
$_REQUEST['peerid'],
$data["message"]["id"]);
$result = $con -> query($query);
$return_data = [ "success" => boolval($result) ];
$message = new CryptoblogMessage($return_data, $_REQUEST['peerid'], CryptoblogMessage::DECRYPTED);
$return_value["data"] = $message -> getMessage();
$return_value["valid"] = $message -> getValid();
}
echo json_encode( $return_value );
?>