summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-notify.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-11-01 17:59:02 +0100
committerSébastien Helleu <flashcode@flashtux.org>2014-11-01 17:59:02 +0100
commitde067ff6a037dfcb591647d56390a75e60fdb0cc (patch)
tree4437a82c675af1b6ba17775d618b36c4d728ce3a /src/plugins/irc/irc-notify.c
parent25c775d850c07d7eaebf301b64e5429a8560f8e4 (diff)
downloadweechat-de067ff6a037dfcb591647d56390a75e60fdb0cc.zip
irc: reformat some code to make it more readable
Diffstat (limited to 'src/plugins/irc/irc-notify.c')
-rw-r--r--src/plugins/irc/irc-notify.c165
1 files changed, 82 insertions, 83 deletions
diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c
index fa9085b03..d8438a442 100644
--- a/src/plugins/irc/irc-notify.c
+++ b/src/plugins/irc/irc-notify.c
@@ -505,38 +505,40 @@ irc_notify_display (struct t_irc_server *server, struct t_gui_buffer *buffer,
if ((notify->is_on_server < 0)
|| (!notify->is_on_server && !notify->away_message))
{
- weechat_printf (buffer,
- " %s%s%s @ %s%s%s: %s%s",
- irc_nick_color_for_msg (server, 1, NULL, notify->nick),
- notify->nick,
- IRC_COLOR_RESET,
- IRC_COLOR_CHAT_SERVER,
- notify->server->name,
- IRC_COLOR_RESET,
- (notify->is_on_server < 0) ? "" : IRC_COLOR_MESSAGE_QUIT,
- (notify->is_on_server < 0) ?
- /* TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) */
- _("unknown") :
- _("offline"));
+ weechat_printf (
+ buffer,
+ " %s%s%s @ %s%s%s: %s%s",
+ irc_nick_color_for_msg (server, 1, NULL, notify->nick),
+ notify->nick,
+ IRC_COLOR_RESET,
+ IRC_COLOR_CHAT_SERVER,
+ notify->server->name,
+ IRC_COLOR_RESET,
+ (notify->is_on_server < 0) ? "" : IRC_COLOR_MESSAGE_QUIT,
+ (notify->is_on_server < 0) ?
+ /* TRANSLATORS: "unknown" is the status for /notify when ison answer has not been received (check pending) */
+ _("unknown") :
+ _("offline"));
}
else
{
- weechat_printf (buffer,
- " %s%s%s @ %s%s%s: %s%s %s%s%s%s%s%s",
- irc_nick_color_for_msg (server, 1, NULL, notify->nick),
- notify->nick,
- IRC_COLOR_RESET,
- IRC_COLOR_CHAT_SERVER,
- notify->server->name,
- IRC_COLOR_RESET,
- IRC_COLOR_MESSAGE_JOIN,
- _("online"),
- IRC_COLOR_RESET,
- (notify->away_message) ? " (" : "",
- (notify->away_message) ? _("away") : "",
- (notify->away_message) ? ": \"" : "",
- (notify->away_message) ? notify->away_message : "",
- (notify->away_message) ? "\")" : "");
+ weechat_printf (
+ buffer,
+ " %s%s%s @ %s%s%s: %s%s %s%s%s%s%s%s",
+ irc_nick_color_for_msg (server, 1, NULL, notify->nick),
+ notify->nick,
+ IRC_COLOR_RESET,
+ IRC_COLOR_CHAT_SERVER,
+ notify->server->name,
+ IRC_COLOR_RESET,
+ IRC_COLOR_MESSAGE_JOIN,
+ _("online"),
+ IRC_COLOR_RESET,
+ (notify->away_message) ? " (" : "",
+ (notify->away_message) ? _("away") : "",
+ (notify->away_message) ? ": \"" : "",
+ (notify->away_message) ? notify->away_message : "",
+ (notify->away_message) ? "\")" : "");
}
}
@@ -670,28 +672,28 @@ irc_notify_set_is_on_server (struct t_irc_notify *notify, const char *host,
if (notify->is_on_server == is_on_server)
return;
- weechat_printf_tags (notify->server->buffer,
- irc_notify_get_tags (irc_config_look_notify_tags_ison,
- (is_on_server) ? "join" : "quit",
- notify->nick),
- (notify->is_on_server < 0) ?
- ((is_on_server) ?
- _("%snotify: %s%s%s%s%s%s%s%s%s is connected") :
- _("%snotify: %s%s%s%s%s%s%s%s%s is offline")) :
- ((is_on_server) ?
- _("%snotify: %s%s%s%s%s%s%s%s%s has connected") :
- _("%snotify: %s%s%s%s%s%s%s%s%s has quit")),
- weechat_prefix ("network"),
- irc_nick_color_for_msg (notify->server, 1, NULL,
- notify->nick),
- notify->nick,
- (host && host[0]) ? IRC_COLOR_CHAT_DELIMITERS : "",
- (host && host[0]) ? " (" : "",
- (host && host[0]) ? IRC_COLOR_CHAT_HOST : "",
- (host && host[0]) ? host : "",
- (host && host[0]) ? IRC_COLOR_CHAT_DELIMITERS : "",
- (host && host[0]) ? ")" : "",
- (is_on_server) ? IRC_COLOR_MESSAGE_JOIN : IRC_COLOR_MESSAGE_QUIT);
+ weechat_printf_tags (
+ notify->server->buffer,
+ irc_notify_get_tags (irc_config_look_notify_tags_ison,
+ (is_on_server) ? "join" : "quit",
+ notify->nick),
+ (notify->is_on_server < 0) ?
+ ((is_on_server) ?
+ _("%snotify: %s%s%s%s%s%s%s%s%s is connected") :
+ _("%snotify: %s%s%s%s%s%s%s%s%s is offline")) :
+ ((is_on_server) ?
+ _("%snotify: %s%s%s%s%s%s%s%s%s has connected") :
+ _("%snotify: %s%s%s%s%s%s%s%s%s has quit")),
+ weechat_prefix ("network"),
+ irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick),
+ notify->nick,
+ (host && host[0]) ? IRC_COLOR_CHAT_DELIMITERS : "",
+ (host && host[0]) ? " (" : "",
+ (host && host[0]) ? IRC_COLOR_CHAT_HOST : "",
+ (host && host[0]) ? host : "",
+ (host && host[0]) ? IRC_COLOR_CHAT_DELIMITERS : "",
+ (host && host[0]) ? ")" : "",
+ (is_on_server) ? IRC_COLOR_MESSAGE_JOIN : IRC_COLOR_MESSAGE_QUIT);
irc_notify_send_signal (notify, (is_on_server) ? "join" : "quit", NULL);
notify->is_on_server = is_on_server;
@@ -717,46 +719,43 @@ irc_notify_set_away_message (struct t_irc_notify *notify,
if (!notify->away_message && away_message)
{
- weechat_printf_tags (notify->server->buffer,
- irc_notify_get_tags (irc_config_look_notify_tags_whois,
- "away",
- notify->nick),
- _("%snotify: %s%s%s is now away: \"%s\""),
- weechat_prefix ("network"),
- irc_nick_color_for_msg (notify->server, 1, NULL,
- notify->nick),
- notify->nick,
- IRC_COLOR_RESET,
- away_message);
+ weechat_printf_tags (
+ notify->server->buffer,
+ irc_notify_get_tags (
+ irc_config_look_notify_tags_whois, "away", notify->nick),
+ _("%snotify: %s%s%s is now away: \"%s\""),
+ weechat_prefix ("network"),
+ irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick),
+ notify->nick,
+ IRC_COLOR_RESET,
+ away_message);
irc_notify_send_signal (notify, "away", away_message);
}
else if (notify->away_message && !away_message)
{
- weechat_printf_tags (notify->server->buffer,
- irc_notify_get_tags (irc_config_look_notify_tags_whois,
- "back",
- notify->nick),
- _("%snotify: %s%s%s is back"),
- weechat_prefix ("network"),
- irc_nick_color_for_msg (notify->server, 1, NULL,
- notify->nick),
- notify->nick,
- IRC_COLOR_RESET);
+ weechat_printf_tags (
+ notify->server->buffer,
+ irc_notify_get_tags (
+ irc_config_look_notify_tags_whois, "back", notify->nick),
+ _("%snotify: %s%s%s is back"),
+ weechat_prefix ("network"),
+ irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick),
+ notify->nick,
+ IRC_COLOR_RESET);
irc_notify_send_signal (notify, "back", NULL);
}
else if (notify->away_message && away_message)
{
- weechat_printf_tags (notify->server->buffer,
- irc_notify_get_tags (irc_config_look_notify_tags_whois,
- "still_away",
- notify->nick),
- _("%snotify: %s%s%s is still away: \"%s\""),
- weechat_prefix ("network"),
- irc_nick_color_for_msg (notify->server, 1, NULL,
- notify->nick),
- notify->nick,
- IRC_COLOR_RESET,
- away_message);
+ weechat_printf_tags (
+ notify->server->buffer,
+ irc_notify_get_tags (
+ irc_config_look_notify_tags_whois, "still_away", notify->nick),
+ _("%snotify: %s%s%s is still away: \"%s\""),
+ weechat_prefix ("network"),
+ irc_nick_color_for_msg (notify->server, 1, NULL, notify->nick),
+ notify->nick,
+ IRC_COLOR_RESET,
+ away_message);
irc_notify_send_signal (notify, "still_away", away_message);
}