<?php
require_once __DIR__ . '/config.php';
$me = must_auth();

try {
    db()->prepare("INSERT INTO presence (username, last_seen, is_typing, typing_to)
                   VALUES (?, DATE_SUB(UTC_TIMESTAMP(), INTERVAL 31 SECOND), 0, '')
                   ON DUPLICATE KEY UPDATE last_seen=DATE_SUB(UTC_TIMESTAMP(), INTERVAL 31 SECOND), is_typing=0, typing_to=''")
       ->execute(array($me));
} catch (Exception $e) {}

ok(array('loggedOut' => true));
