away reply cleanup
This commit is contained in:
parent
b5bec6c601
commit
cdbb445319
|
@ -305,8 +305,10 @@ let on_privmsg_chan from chan =
|
|||
|
||||
let on_privmsg_user _from user =
|
||||
match User.away user with
|
||||
| Some text -> Error (away (User.nick user) text)
|
||||
| None -> Ok (User.nick user, [`to_user user])
|
||||
| Some text ->
|
||||
Error (away (User.nick user) text)
|
||||
| None ->
|
||||
Ok (User.nick user, [`to_user user])
|
||||
|
||||
let on_msg_privmsg t tgt txt =
|
||||
let* me = require_registered t in
|
||||
|
@ -323,17 +325,18 @@ let on_msg_privmsg t tgt txt =
|
|||
Router.relay msg ~from:me tgts;
|
||||
Ok ()
|
||||
|
||||
let on_msg_away t status =
|
||||
let* me = require_registered t in
|
||||
let set_away t me status =
|
||||
if status <> User.away me then
|
||||
begin
|
||||
let rpl = match status with
|
||||
| None -> "305", ["You are no longer marked as being away"]
|
||||
| Some _ -> "306", ["You have been marked as being away"]
|
||||
in
|
||||
User.set_away me status;
|
||||
reply t rpl
|
||||
end;
|
||||
match status with
|
||||
| None -> reply t ("305", ["You are no longer marked as being away"])
|
||||
| Some _ -> reply t ("306", ["You have been marked as being away"])
|
||||
end
|
||||
|
||||
let on_msg_away t status =
|
||||
let* me = require_registered t in
|
||||
set_away t me status;
|
||||
Ok ()
|
||||
|
||||
let list_names t me chan =
|
||||
|
|
Loading…
Reference in New Issue