1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Added mention match preferences

This commit is contained in:
James Booth 2016-04-03 23:33:21 +01:00
parent d9344b00fe
commit afa2c0f5ba
3 changed files with 12 additions and 4 deletions

View File

@ -1230,6 +1230,8 @@ _get_group(preference_t pref)
case PREF_NOTIFY_ROOM_TEXT:
case PREF_NOTIFY_INVITE:
case PREF_NOTIFY_SUB:
case PREF_MENTION_CASE_SENSITIVE:
case PREF_MENTION_WHOLE_WORD:
return PREF_GROUP_NOTIFICATIONS;
case PREF_CHLOG:
case PREF_GRLOG:
@ -1332,6 +1334,10 @@ _get_key(preference_t pref)
return "invite";
case PREF_NOTIFY_SUB:
return "sub";
case PREF_MENTION_CASE_SENSITIVE:
return "room.mention.casesensitive";
case PREF_MENTION_WHOLE_WORD:
return "room.mention.wholeword";
case PREF_CHLOG:
return "chlog";
case PREF_GRLOG:
@ -1488,6 +1494,8 @@ _get_default_boolean(preference_t pref)
case PREF_ROSTER_ROOMS:
case PREF_TLS_SHOW:
case PREF_LASTACTIVITY:
case PREF_MENTION_CASE_SENSITIVE:
case PREF_MENTION_WHOLE_WORD:
return TRUE;
default:
return FALSE;

View File

@ -113,6 +113,8 @@ typedef enum {
PREF_NOTIFY_ROOM_TEXT,
PREF_NOTIFY_INVITE,
PREF_NOTIFY_SUB,
PREF_MENTION_CASE_SENSITIVE,
PREF_MENTION_WHOLE_WORD,
PREF_CHLOG,
PREF_GRLOG,
PREF_AUTOAWAY_CHECK,

View File

@ -251,10 +251,8 @@ sv_ev_room_message(const char *const room_jid, const char *const nick, const cha
char *new_message = plugins_pre_room_message_display(room_jid, nick, message);
char *mynick = muc_nick(mucwin->roomjid);
// gboolean case_sensitive = prefs_get_boolean(PREF_MENTION_CASE_SENSITIVE);
// gboolean whole_word = prefs_get_boolean(PREF_MENTION_WHOLE_WORD);
gboolean case_sensitive = FALSE;
gboolean whole_word = FALSE;
gboolean case_sensitive = prefs_get_boolean(PREF_MENTION_CASE_SENSITIVE);
gboolean whole_word = prefs_get_boolean(PREF_MENTION_WHOLE_WORD);
gboolean mention = prof_strstr(mynick, new_message, case_sensitive, whole_word);
GList *triggers = prefs_message_get_triggers(new_message);