summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/fe-common-core.c17
-rw-r--r--src/fe-common/core/fe-common-core.h4
-rw-r--r--src/fe-common/core/window-activity.c11
3 files changed, 23 insertions, 9 deletions
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c
index 88841f37..2b88b946 100644
--- a/src/fe-common/core/fe-common-core.c
+++ b/src/fe-common/core/fe-common-core.c
@@ -463,3 +463,20 @@ void fe_common_core_finish_init(void)
autorun_startup();
autoconnect_servers();
}
+
+gboolean strarray_find_dest(char **array, const TEXT_DEST_REC *dest)
+{
+ g_return_val_if_fail(array != NULL, FALSE);
+
+ if (strarray_find(array, dest->target) != -1)
+ return TRUE;
+
+ if (dest->server_tag != NULL) {
+ char *tagtarget = g_strdup_printf("%s/%s", dest->server_tag, dest->target);
+ int ret = strarray_find(array, tagtarget);
+ g_free(tagtarget);
+ if (ret != -1)
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/src/fe-common/core/fe-common-core.h b/src/fe-common/core/fe-common-core.h
index 7f3078de..88b2e94b 100644
--- a/src/fe-common/core/fe-common-core.h
+++ b/src/fe-common/core/fe-common-core.h
@@ -6,4 +6,8 @@ void fe_common_core_init(void);
void fe_common_core_deinit(void);
void fe_common_core_finish_init(void);
+/* Returns TRUE if "dest->target" or "dest->server_tag/dest->target" is found in
+ * array, otherwise FALSE. */
+gboolean strarray_find_dest(char **array, const TEXT_DEST_REC *dest);
+
#endif
diff --git a/src/fe-common/core/window-activity.c b/src/fe-common/core/window-activity.c
index 4c3fea78..3be30ae7 100644
--- a/src/fe-common/core/window-activity.c
+++ b/src/fe-common/core/window-activity.c
@@ -31,6 +31,7 @@
#include "nicklist.h"
#include "hilight-text.h"
#include "formats.h"
+#include "fe-common-core.h"
static char **hide_targets;
static int hide_level, msg_level, hilight_level;
@@ -86,16 +87,8 @@ static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg)
if (hide_targets != NULL && (dest->level & MSGLEVEL_HILIGHT) == 0 && dest->target != NULL) {
/* check for both target and tag/target */
- if (strarray_find(hide_targets, dest->target) != -1)
+ if (strarray_find_dest(hide_targets, dest))
return;
-
- if (dest->server_tag != NULL) {
- char *tagtarget = g_strdup_printf("%s/%s", dest->server_tag, dest->target);
- int ret = strarray_find(hide_targets, tagtarget);
- g_free(tagtarget);
- if (ret != -1)
- return;
- }
}
if (dest->target != NULL) {