Please just set this to (int) $user->data['user_unread_privmsg'] then.