You are here

function drupalchat_user_login in DrupalChat 7.2

Same name and namespace in other branches
  1. 8 drupalchat.module \drupalchat_user_login()
  2. 7 drupalchat.module \drupalchat_user_login()

Implements hook_user_login().

File

./drupalchat.module, line 456
Module code for DrupalChat.

Code

function drupalchat_user_login(&$edit, $account) {
  setcookie("DRUPALCHAT_NEWLOGIN", 1, time() + 120, '/');
  if (check_plain(variable_get('drupalchat_polling_method', DRUPALCHAT_AJAX)) == DRUPALCHAT_COMMERCIAL) {
    setcookie("iflychat_key", "", time() - 3600, "/");
    setcookie("iflychat_css", "", time() - 3600, "/");
    setcookie("iflychat_time", "", time() - 3600, "/");
  }

  // TODO Please review the conversion of this statement to the D7 database API syntax.

  /* db_query('DELETE FROM {drupalchat_msg} WHERE uid1 = uid2 AND uid1 = %d', $account->uid) */
  db_delete('drupalchat_msg')
    ->where('uid1 = uid2')
    ->condition('uid1', $account->uid)
    ->execute();
}