From 36afafb9e6ab5842de928439427f05a8a33042a6 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Thu, 13 Jan 2005 23:04:47 +0000 Subject: [PATCH] * src/mod_irc/mod_irc_connection.erl: Added filtering of quit status * src/web/ejabberd_web_admin.erl: Copyright update * src/mod_vcard_ldap.erl: Likewise * src/mod_vcard.erl: Likewise * src/mod_pubsub/mod_pubsub.erl: Likewise * src/mod_muc/mod_muc.erl: Likewise * src/mod_irc/mod_irc.erl: Likewise SVN Revision: 296 --- ChangeLog | 14 +++++ src/mod_irc/mod_irc.erl | 2 +- src/mod_irc/mod_irc_connection.erl | 94 ++++++++---------------------- src/mod_muc/mod_muc.erl | 2 +- src/mod_pubsub/mod_pubsub.erl | 2 +- src/mod_vcard.erl | 4 +- src/mod_vcard_ldap.erl | 4 +- src/web/ejabberd_web_admin.erl | 2 +- 8 files changed, 47 insertions(+), 77 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fc3de883..f82f74e7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2005-01-14 Alexey Shchepin + + * src/mod_irc/mod_irc_connection.erl: Added filtering of quit + status + +2005-01-04 Alexey Shchepin + + * src/web/ejabberd_web_admin.erl: Copyright update + * src/mod_vcard_ldap.erl: Likewise + * src/mod_vcard.erl: Likewise + * src/mod_pubsub/mod_pubsub.erl: Likewise + * src/mod_muc/mod_muc.erl: Likewise + * src/mod_irc/mod_irc.erl: Likewise + 2004-12-30 Alexey Shchepin * src/odbc/ejabberd_odbc.erl: Load-balance ODBC requests between diff --git a/src/mod_irc/mod_irc.erl b/src/mod_irc/mod_irc.erl index efa3c995e..1a9d78ce2 100644 --- a/src/mod_irc/mod_irc.erl +++ b/src/mod_irc/mod_irc.erl @@ -199,7 +199,7 @@ iq_get_vcard(Lang) -> "http://ejabberd.jabberstudio.org/"}]}, {xmlelement, "DESC", [], [{xmlcdata, translate:translate(Lang, "ejabberd IRC module\n" - "Copyright (c) 2003-2004 Alexey Shchepin")}]}]. + "Copyright (c) 2003-2005 Alexey Shchepin")}]}]. process_register(From, To, #iq{} = IQ) -> case catch process_irc_register(From, To, IQ) of diff --git a/src/mod_irc/mod_irc_connection.erl b/src/mod_irc/mod_irc_connection.erl index f4e1c29d3..fff4fedf8 100644 --- a/src/mod_irc/mod_irc_connection.erl +++ b/src/mod_irc/mod_irc_connection.erl @@ -614,16 +614,7 @@ process_channel_list_user(StateData, Chan, User) -> process_channel_topic(StateData, Chan, String) -> FromUser = "someone", {ok, Msg, _} = regexp:sub(String, ".*332[^:]*:", ""), - Msg1 = lists:filter( - fun(C) -> - if (C < 32) and - (C /= 9) and - (C /= 10) and - (C /= 13) -> - false; - true -> true - end - end, Msg), + Msg1 = filter_message(Msg), ejabberd_router:route( jlib:make_jid( lists:concat([Chan, "%", StateData#state.server]), @@ -642,16 +633,7 @@ process_chanprivmsg(StateData, Chan, From, String) -> _ -> Msg end, - Msg2 = lists:filter( - fun(C) -> - if (C < 32) and - (C /= 9) and - (C /= 10) and - (C /= 13) -> - false; - true -> true - end - end, Msg1), + Msg2 = filter_message(Msg1), ejabberd_router:route( jlib:make_jid(lists:concat([Chan, "%", StateData#state.server]), StateData#state.myname, FromUser), @@ -670,16 +652,7 @@ process_channotice(StateData, Chan, From, String) -> _ -> Msg end, - Msg2 = lists:filter( - fun(C) -> - if (C < 32) and - (C /= 9) and - (C /= 10) and - (C /= 13) -> - false; - true -> true - end - end, Msg1), + Msg2 = filter_message(Msg1), ejabberd_router:route( jlib:make_jid(lists:concat([Chan, "%", StateData#state.server]), StateData#state.myname, FromUser), @@ -699,16 +672,7 @@ process_privmsg(StateData, Nick, From, String) -> _ -> Msg end, - Msg2 = lists:filter( - fun(C) -> - if (C < 32) and - (C /= 9) and - (C /= 10) and - (C /= 13) -> - false; - true -> true - end - end, Msg1), + Msg2 = filter_message(Msg1), ejabberd_router:route( jlib:make_jid(lists:concat([FromUser, "!", StateData#state.server]), StateData#state.myname, ""), @@ -726,16 +690,7 @@ process_notice(StateData, Nick, From, String) -> _ -> Msg end, - Msg2 = lists:filter( - fun(C) -> - if (C < 32) and - (C /= 9) and - (C /= 10) and - (C /= 13) -> - false; - true -> true - end - end, Msg1), + Msg2 = filter_message(Msg1), ejabberd_router:route( jlib:make_jid(lists:concat([FromUser, "!", StateData#state.server]), StateData#state.myname, ""), @@ -761,16 +716,7 @@ process_version(StateData, Nick, From) -> process_topic(StateData, Chan, From, String) -> [FromUser | _] = string:tokens(From, "!"), {ok, Msg, _} = regexp:sub(String, ".*TOPIC[^:]*:", ""), - Msg1 = lists:filter( - fun(C) -> - if (C < 32) and - (C /= 9) and - (C /= 10) and - (C /= 13) -> - false; - true -> true - end - end, Msg), + Msg1 = filter_message(Msg), ejabberd_router:route( jlib:make_jid(lists:concat([Chan, "%", StateData#state.server]), StateData#state.myname, FromUser), @@ -784,6 +730,7 @@ process_topic(StateData, Chan, From, String) -> process_part(StateData, Chan, From, String) -> [FromUser | FromIdent] = string:tokens(From, "!"), {ok, Msg, _} = regexp:sub(String, ".*PART[^:]*", ""), + Msg1 = filter_message(Msg), ejabberd_router:route( jlib:make_jid(lists:concat([Chan, "%", StateData#state.server]), StateData#state.myname, FromUser), @@ -791,7 +738,7 @@ process_part(StateData, Chan, From, String) -> {xmlelement, "message", [{"type", "groupchat"}], [{xmlelement, "body", [], [{xmlcdata, "/me has part: " ++ - Msg ++ "(" ++ FromIdent ++ ")" }]}]}), + Msg1 ++ "(" ++ FromIdent ++ ")" }]}]}), ejabberd_router:route( jlib:make_jid(lists:concat([Chan, "%", StateData#state.server]), @@ -804,7 +751,7 @@ process_part(StateData, Chan, From, String) -> {"role", "none"}], []}]}, {xmlelement, "status", [], - [{xmlcdata, Msg ++ "(" ++ FromIdent ++ ")"}]}] + [{xmlcdata, Msg1 ++ "(" ++ FromIdent ++ ")"}]}] }), case catch dict:update(Chan, fun(Ps) -> @@ -821,6 +768,7 @@ process_quit(StateData, From, String) -> [FromUser | FromIdent] = string:tokens(From, "!"), {ok, Msg, _} = regexp:sub(String, ".*QUIT[^:]*:", ""), + Msg1 = filter_message(Msg), NewChans = dict:map( fun(Chan, Ps) -> @@ -834,7 +782,7 @@ process_quit(StateData, From, String) -> {xmlelement, "message", [{"type", "groupchat"}], [{xmlelement, "body", [], [{xmlcdata, "/me has quit: " ++ - Msg ++ "(" ++ FromIdent ++ ")" }]}]}), + Msg1 ++ "(" ++ FromIdent ++ ")" }]}]}), ejabberd_router:route( jlib:make_jid( @@ -848,7 +796,7 @@ process_quit(StateData, From, String) -> {"role", "none"}], []}]}, {xmlelement, "status", [], - [{xmlcdata, Msg ++ "(" ++ FromIdent ++ ")"}]} + [{xmlcdata, Msg1 ++ "(" ++ FromIdent ++ ")"}]} ]}), remove_element(FromUser, Ps); _ -> @@ -874,6 +822,7 @@ process_join(StateData, Channel, From, String) -> {xmlelement, "status", [], [{xmlcdata, FromIdent}]}]}), {ok, Msg, _} = regexp:sub(String, ".*JOIN[^:]*:", ""), + Msg1 = filter_message(Msg), ejabberd_router:route( jlib:make_jid(lists:concat([Chan, "%", StateData#state.server]), StateData#state.myname, FromUser), @@ -881,7 +830,7 @@ process_join(StateData, Channel, From, String) -> {xmlelement, "message", [{"type", "groupchat"}], [{xmlelement, "body", [], [{xmlcdata, "/me has joined " ++ - Msg ++ "(" ++ FromIdent ++ ")" }]}]}), + Msg1 ++ "(" ++ FromIdent ++ ")" }]}]}), case catch dict:update(Chan, fun(Ps) -> @@ -1058,7 +1007,14 @@ process_admin(StateData, Channel, Nick, Affiliation, Role, Reason) -> - - - - +filter_message(Msg) -> + lists:filter( + fun(C) -> + if (C < 32) and + (C /= 9) and + (C /= 10) and + (C /= 13) -> + false; + true -> true + end + end, Msg). diff --git a/src/mod_muc/mod_muc.erl b/src/mod_muc/mod_muc.erl index 81fd87c9c..b7f5862b8 100644 --- a/src/mod_muc/mod_muc.erl +++ b/src/mod_muc/mod_muc.erl @@ -444,7 +444,7 @@ iq_get_vcard(Lang) -> "http://ejabberd.jabberstudio.org/"}]}, {xmlelement, "DESC", [], [{xmlcdata, translate:translate(Lang, "ejabberd MUC module\n" - "Copyright (c) 2003-2004 Alexey Shchepin")}]}]. + "Copyright (c) 2003-2005 Alexey Shchepin")}]}]. broadcast_service_message(Msg) -> diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index 3a9a93c6a..e73a8d015 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -390,7 +390,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, translate:translate( Lang, "ejabberd pub/sub module\n" - "Copyright (c) 2003-2004 Alexey Shchepin")}]}]. + "Copyright (c) 2003-2005 Alexey Shchepin")}]}]. iq_pubsub(Host, From, Type, SubEl) -> diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 08789f115..db380cb83 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -126,7 +126,7 @@ process_local_iq(_From, _To, #iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) translate:translate( Lang, "Erlang Jabber Server\n" - "Copyright (c) 2002-2004 Alexey Shchepin")}]}, + "Copyright (c) 2002-2005 Alexey Shchepin")}]}, {xmlelement, "BDAY", [], [{xmlcdata, "2002-11-16"}]} ]}]} @@ -390,7 +390,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, translate:translate( Lang, "ejabberd vCard module\n" - "Copyright (c) 2003-2004 Alexey Shchepin")}]}]. + "Copyright (c) 2003-2005 Alexey Shchepin")}]}]. find_xdata_el({xmlelement, _Name, _Attrs, SubEls}) -> find_xdata_el1(SubEls). diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index 5be8cf0f9..2eccf84c9 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -86,7 +86,7 @@ process_local_iq(_From, _To, #iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) translate:translate( Lang, "Erlang Jabber Server\n" - "Copyright (c) 2002-2004 Alexey Shchepin")}]}, + "Copyright (c) 2002-2005 Alexey Shchepin")}]}, {xmlelement, "BDAY", [], [{xmlcdata, "2002-11-16"}]} ]}]} @@ -361,7 +361,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, translate:translate( Lang, "ejabberd vCard module\n" - "Copyright (c) 2003-2004 Alexey Shchepin")}]}]. + "Copyright (c) 2003-2005 Alexey Shchepin")}]}]. find_xdata_el({xmlelement, _Name, _Attrs, SubEls}) -> find_xdata_el1(SubEls). diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 49531222a..7e396b6ac 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -119,7 +119,7 @@ make_xhtml(Els, Lang) -> [?XE("tbody", [?XE("tr", [?XCT("td", - "ejabberd (c) 2002-2004 Alexey Shchepin, 2004 Process One") + "ejabberd (c) 2002-2005 Alexey Shchepin, 2004 Process One") ])]) ])])])])])]) ]}}.