Merge branch 'master' into winbuffers

Conflicts:
	src/ui/core.c
This commit is contained in:
James Booth
2014-07-16 20:03:08 +01:00
4 changed files with 46 additions and 33 deletions

View File

@@ -89,6 +89,7 @@ static struct colours_t {
NCURSES_COLOR_T error; NCURSES_COLOR_T error;
NCURSES_COLOR_T incoming; NCURSES_COLOR_T incoming;
NCURSES_COLOR_T roominfo; NCURSES_COLOR_T roominfo;
NCURSES_COLOR_T roommention;
NCURSES_COLOR_T me; NCURSES_COLOR_T me;
NCURSES_COLOR_T them; NCURSES_COLOR_T them;
NCURSES_COLOR_T otrstartedtrusted; NCURSES_COLOR_T otrstartedtrusted;
@@ -202,29 +203,30 @@ theme_init_colours(void)
// room chat // room chat
init_pair(19, colour_prefs.roominfo, colour_prefs.bkgnd); init_pair(19, colour_prefs.roominfo, colour_prefs.bkgnd);
init_pair(20, colour_prefs.roommention, colour_prefs.bkgnd);
// statuses // statuses
init_pair(20, colour_prefs.online, colour_prefs.bkgnd); init_pair(21, colour_prefs.online, colour_prefs.bkgnd);
init_pair(21, colour_prefs.offline, colour_prefs.bkgnd); init_pair(22, colour_prefs.offline, colour_prefs.bkgnd);
init_pair(22, colour_prefs.away, colour_prefs.bkgnd); init_pair(23, colour_prefs.away, colour_prefs.bkgnd);
init_pair(23, colour_prefs.chat, colour_prefs.bkgnd); init_pair(24, colour_prefs.chat, colour_prefs.bkgnd);
init_pair(24, colour_prefs.dnd, colour_prefs.bkgnd); init_pair(25, colour_prefs.dnd, colour_prefs.bkgnd);
init_pair(25, colour_prefs.xa, colour_prefs.bkgnd); init_pair(26, colour_prefs.xa, colour_prefs.bkgnd);
// states // states
init_pair(26, colour_prefs.typing, colour_prefs.bkgnd); init_pair(27, colour_prefs.typing, colour_prefs.bkgnd);
init_pair(27, colour_prefs.gone, colour_prefs.bkgnd); init_pair(28, colour_prefs.gone, colour_prefs.bkgnd);
// subscription status // subscription status
init_pair(28, colour_prefs.subscribed, colour_prefs.bkgnd); init_pair(29, colour_prefs.subscribed, colour_prefs.bkgnd);
init_pair(29, colour_prefs.unsubscribed, colour_prefs.bkgnd); init_pair(30, colour_prefs.unsubscribed, colour_prefs.bkgnd);
// otr messages // otr messages
init_pair(30, colour_prefs.otrstartedtrusted, colour_prefs.bkgnd); init_pair(31, colour_prefs.otrstartedtrusted, colour_prefs.bkgnd);
init_pair(31, colour_prefs.otrstarteduntrusted, colour_prefs.bkgnd); init_pair(32, colour_prefs.otrstarteduntrusted, colour_prefs.bkgnd);
init_pair(32, colour_prefs.otrended, colour_prefs.bkgnd); init_pair(33, colour_prefs.otrended, colour_prefs.bkgnd);
init_pair(33, colour_prefs.otrtrusted, colour_prefs.bkgnd); init_pair(34, colour_prefs.otrtrusted, colour_prefs.bkgnd);
init_pair(34, colour_prefs.otruntrusted, colour_prefs.bkgnd); init_pair(35, colour_prefs.otruntrusted, colour_prefs.bkgnd);
} }
static NCURSES_COLOR_T static NCURSES_COLOR_T
@@ -399,6 +401,10 @@ _load_colours(void)
_set_colour(roominfo_val, &colour_prefs.roominfo, COLOR_YELLOW); _set_colour(roominfo_val, &colour_prefs.roominfo, COLOR_YELLOW);
g_free(roominfo_val); g_free(roominfo_val);
gchar *roommention_val = g_key_file_get_string(theme, "colours", "roommention", NULL);
_set_colour(roommention_val, &colour_prefs.roommention, COLOR_YELLOW);
g_free(roommention_val);
gchar *me_val = g_key_file_get_string(theme, "colours", "me", NULL); gchar *me_val = g_key_file_get_string(theme, "colours", "me", NULL);
_set_colour(me_val, &colour_prefs.me, COLOR_YELLOW); _set_colour(me_val, &colour_prefs.me, COLOR_YELLOW);
g_free(me_val); g_free(me_val);

View File

@@ -51,21 +51,22 @@
#define COLOUR_ME COLOR_PAIR(17) #define COLOUR_ME COLOR_PAIR(17)
#define COLOUR_THEM COLOR_PAIR(18) #define COLOUR_THEM COLOR_PAIR(18)
#define COLOUR_ROOMINFO COLOR_PAIR(19) #define COLOUR_ROOMINFO COLOR_PAIR(19)
#define COLOUR_ONLINE COLOR_PAIR(20) #define COLOUR_ROOMMENTION COLOR_PAIR(20)
#define COLOUR_OFFLINE COLOR_PAIR(21) #define COLOUR_ONLINE COLOR_PAIR(21)
#define COLOUR_AWAY COLOR_PAIR(22) #define COLOUR_OFFLINE COLOR_PAIR(22)
#define COLOUR_CHAT COLOR_PAIR(23) #define COLOUR_AWAY COLOR_PAIR(23)
#define COLOUR_DND COLOR_PAIR(24) #define COLOUR_CHAT COLOR_PAIR(24)
#define COLOUR_XA COLOR_PAIR(25) #define COLOUR_DND COLOR_PAIR(25)
#define COLOUR_TYPING COLOR_PAIR(26) #define COLOUR_XA COLOR_PAIR(26)
#define COLOUR_GONE COLOR_PAIR(27) #define COLOUR_TYPING COLOR_PAIR(27)
#define COLOUR_SUBSCRIBED COLOR_PAIR(28) #define COLOUR_GONE COLOR_PAIR(28)
#define COLOUR_UNSUBSCRIBED COLOR_PAIR(29) #define COLOUR_SUBSCRIBED COLOR_PAIR(29)
#define COLOUR_OTR_STARTED_TRUSTED COLOR_PAIR(30) #define COLOUR_UNSUBSCRIBED COLOR_PAIR(30)
#define COLOUR_OTR_STARTED_UNTRUSTED COLOR_PAIR(31) #define COLOUR_OTR_STARTED_TRUSTED COLOR_PAIR(31)
#define COLOUR_OTR_ENDED COLOR_PAIR(32) #define COLOUR_OTR_STARTED_UNTRUSTED COLOR_PAIR(32)
#define COLOUR_OTR_TRUSTED COLOR_PAIR(33) #define COLOUR_OTR_ENDED COLOR_PAIR(33)
#define COLOUR_OTR_UNTRUSTED COLOR_PAIR(34) #define COLOUR_OTR_TRUSTED COLOR_PAIR(34)
#define COLOUR_OTR_UNTRUSTED COLOR_PAIR(35)
void theme_init(const char * const theme_name); void theme_init(const char * const theme_name);
void theme_init_colours(void); void theme_init_colours(void);

View File

@@ -1595,9 +1595,14 @@ _ui_room_message(const char * const room_jid, const char * const nick,
{ {
ProfWin *window = wins_get_by_recipient(room_jid); ProfWin *window = wins_get_by_recipient(room_jid);
int num = wins_get_num(window); int num = wins_get_num(window);
char *my_nick = muc_get_room_nick(room_jid);
if (strcmp(nick, muc_get_room_nick(room_jid)) != 0) { if (strcmp(nick, my_nick) != 0) {
win_save_print(window, '-', NULL, 1, 0, nick, message); if (g_strrstr(message, my_nick) != NULL) {
win_save_print(window, '-', NULL, 1, COLOUR_ROOMMENTION, nick, message);
} else {
win_save_print(window, '-', NULL, 1, 0, nick, message);
}
} else { } else {
win_save_print(window, '-', NULL, 0, 0, nick, message); win_save_print(window, '-', NULL, 0, 0, nick, message);
} }
@@ -1616,7 +1621,7 @@ _ui_room_message(const char * const room_jid, const char * const nick,
win_update_virtual(current); win_update_virtual(current);
} }
if (strcmp(nick, muc_get_room_nick(room_jid)) != 0) { if (strcmp(nick, my_nick) != 0) {
if (prefs_get_boolean(PREF_FLASH)) { if (prefs_get_boolean(PREF_FLASH)) {
flash(); flash();
} }

View File

@@ -23,6 +23,7 @@ gone=red
error=red error=red
incoming=yellow incoming=yellow
roominfo=blue roominfo=blue
roommention=cyan
me=blue me=blue
them=green them=green
titlebar.unencrypted=red titlebar.unencrypted=red