mirror of
https://github.com/profanity-im/profanity.git
synced 2024-09-01 19:24:15 -04:00
Merge pull request #1607 from profanity-im/utf8indicatorchar
Allow more UI indicator signs to be utf8 "characters"
This commit is contained in:
commit
56846a5b77
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
flavor: [debian, fedora, ubuntu]
|
||||
flavor: [debian, fedora]
|
||||
|
||||
name: Linux
|
||||
steps:
|
||||
|
@ -2388,8 +2388,8 @@ cmd_roster(ProfWin* window, const char* const command, gchar** args)
|
||||
cons_show("Roster header char removed.");
|
||||
rosterwin_roster();
|
||||
} else {
|
||||
prefs_set_roster_header_char(args[2][0]);
|
||||
cons_show("Roster header char set to %c.", args[2][0]);
|
||||
prefs_set_roster_header_char(args[2]);
|
||||
cons_show("Roster header char set to %s.", args[2]);
|
||||
rosterwin_roster();
|
||||
}
|
||||
} else {
|
||||
@ -2407,8 +2407,8 @@ cmd_roster(ProfWin* window, const char* const command, gchar** args)
|
||||
cons_show("Roster contact char removed.");
|
||||
rosterwin_roster();
|
||||
} else {
|
||||
prefs_set_roster_contact_char(args[2][0]);
|
||||
cons_show("Roster contact char set to %c.", args[2][0]);
|
||||
prefs_set_roster_contact_char(args[2]);
|
||||
cons_show("Roster contact char set to %s.", args[2]);
|
||||
rosterwin_roster();
|
||||
}
|
||||
} else if (g_strcmp0(args[1], "indent") == 0) {
|
||||
@ -2442,8 +2442,8 @@ cmd_roster(ProfWin* window, const char* const command, gchar** args)
|
||||
cons_show("Roster resource char removed.");
|
||||
rosterwin_roster();
|
||||
} else {
|
||||
prefs_set_roster_resource_char(args[2][0]);
|
||||
cons_show("Roster resource char set to %c.", args[2][0]);
|
||||
prefs_set_roster_resource_char(args[2]);
|
||||
cons_show("Roster resource char set to %s.", args[2]);
|
||||
rosterwin_roster();
|
||||
}
|
||||
} else if (g_strcmp0(args[1], "indent") == 0) {
|
||||
@ -2680,8 +2680,8 @@ cmd_roster(ProfWin* window, const char* const command, gchar** args)
|
||||
cons_show("Roster private room chat char removed.");
|
||||
rosterwin_roster();
|
||||
} else {
|
||||
prefs_set_roster_private_char(args[2][0]);
|
||||
cons_show("Roster private room chat char set to %c.", args[2][0]);
|
||||
prefs_set_roster_private_char(args[2]);
|
||||
cons_show("Roster private room chat char set to %s.", args[2]);
|
||||
rosterwin_roster();
|
||||
}
|
||||
return TRUE;
|
||||
@ -2720,8 +2720,8 @@ cmd_roster(ProfWin* window, const char* const command, gchar** args)
|
||||
cons_show("Roster room char removed.");
|
||||
rosterwin_roster();
|
||||
} else {
|
||||
prefs_set_roster_room_char(args[2][0]);
|
||||
cons_show("Roster room char set to %c.", args[2][0]);
|
||||
prefs_set_roster_room_char(args[2]);
|
||||
cons_show("Roster room char set to %s.", args[2]);
|
||||
rosterwin_roster();
|
||||
}
|
||||
return TRUE;
|
||||
@ -2798,8 +2798,8 @@ cmd_roster(ProfWin* window, const char* const command, gchar** args)
|
||||
cons_show("Roster room private char removed.");
|
||||
rosterwin_roster();
|
||||
} else {
|
||||
prefs_set_roster_room_private_char(args[3][0]);
|
||||
cons_show("Roster room private char set to %c.", args[3][0]);
|
||||
prefs_set_roster_room_private_char(args[3]);
|
||||
cons_show("Roster room private char set to %s.", args[3]);
|
||||
rosterwin_roster();
|
||||
}
|
||||
return TRUE;
|
||||
@ -4414,8 +4414,8 @@ cmd_occupants(ProfWin* window, const char* const command, gchar** args)
|
||||
|
||||
occupantswin_occupants_all();
|
||||
} else {
|
||||
prefs_set_occupants_char(args[1][0]);
|
||||
cons_show("Occupants char set to %c.", args[1][0]);
|
||||
prefs_set_occupants_char(args[1]);
|
||||
cons_show("Occupants char set to %s.", args[1]);
|
||||
|
||||
occupantswin_occupants_all();
|
||||
}
|
||||
@ -4470,8 +4470,8 @@ cmd_occupants(ProfWin* window, const char* const command, gchar** args)
|
||||
|
||||
occupantswin_occupants_all();
|
||||
} else {
|
||||
prefs_set_occupants_header_char(args[2][0]);
|
||||
cons_show("Occupants header char set to %c.", args[2][0]);
|
||||
prefs_set_occupants_header_char(args[2]);
|
||||
cons_show("Occupants header char set to %s.", args[2]);
|
||||
|
||||
occupantswin_occupants_all();
|
||||
}
|
||||
|
@ -902,30 +902,23 @@ prefs_get_occupants_size(void)
|
||||
}
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_occupants_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "occupants.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "occupants.char", NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_occupants_char(char ch)
|
||||
prefs_set_occupants_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "occupants.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "occupants.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster resource char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -955,30 +948,22 @@ prefs_set_occupants_indent(gint value)
|
||||
g_key_file_set_integer(prefs, PREF_GROUP_UI, "occupants.indent", value);
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_occupants_header_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "occupants.header.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "occupants.header.char", NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_occupants_header_char(char ch)
|
||||
prefs_set_occupants_header_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "occupants.header.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "occupants.header.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster resource char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -1080,62 +1065,52 @@ prefs_set_omemo_char(char* ch)
|
||||
return _prefs_set_encryption_char(ch, PREF_GROUP_OMEMO, "omemo.char");
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_roster_header_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
char* result = NULL;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.header.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
if (resultstr) {
|
||||
result = resultstr;
|
||||
}
|
||||
free(resultstr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_roster_header_char(char ch)
|
||||
prefs_set_roster_header_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.header.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.header.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster header char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
prefs_clear_roster_header_char(void)
|
||||
{
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.header.char", NULL);
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_roster_contact_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.contact.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.contact.char", NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_roster_contact_char(char ch)
|
||||
prefs_set_roster_contact_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.contact.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.contact.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster contact char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -1144,30 +1119,22 @@ prefs_clear_roster_contact_char(void)
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.contact.char", NULL);
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_roster_resource_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.resource.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.resource.char", NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_roster_resource_char(char ch)
|
||||
prefs_set_roster_resource_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.resource.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.resource.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster resource char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -1176,30 +1143,22 @@ prefs_clear_roster_resource_char(void)
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.resource.char", NULL);
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_roster_private_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.private.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.private.char", NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_roster_private_char(char ch)
|
||||
prefs_set_roster_private_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.private.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.private.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster resource char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -1208,30 +1167,22 @@ prefs_clear_roster_private_char(void)
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.private.char", NULL);
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_roster_room_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.char", NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_roster_room_char(char ch)
|
||||
prefs_set_roster_room_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster resource char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -1240,30 +1191,22 @@ prefs_clear_roster_room_char(void)
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.rooms.char", NULL);
|
||||
}
|
||||
|
||||
char
|
||||
char*
|
||||
prefs_get_roster_room_private_char(void)
|
||||
{
|
||||
char result = 0;
|
||||
|
||||
char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.private.char", NULL);
|
||||
if (!resultstr) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = resultstr[0];
|
||||
}
|
||||
free(resultstr);
|
||||
char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.private.char", NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_roster_room_private_char(char ch)
|
||||
prefs_set_roster_room_private_char(char* ch)
|
||||
{
|
||||
char str[2];
|
||||
str[0] = ch;
|
||||
str[1] = '\0';
|
||||
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.private.char", str);
|
||||
if (g_utf8_strlen(ch, 4) == 1) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.private.char", ch);
|
||||
} else {
|
||||
log_error("Could not set roster resource char: %s", ch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -254,29 +254,29 @@ gboolean prefs_set_omemo_char(char* ch);
|
||||
char* prefs_get_ox_char(void);
|
||||
gboolean prefs_set_ox_char(char* ch);
|
||||
|
||||
char prefs_get_roster_header_char(void);
|
||||
void prefs_set_roster_header_char(char ch);
|
||||
char* prefs_get_roster_header_char(void);
|
||||
void prefs_set_roster_header_char(char* ch);
|
||||
void prefs_clear_roster_header_char(void);
|
||||
char prefs_get_roster_contact_char(void);
|
||||
void prefs_set_roster_contact_char(char ch);
|
||||
char* prefs_get_roster_contact_char(void);
|
||||
void prefs_set_roster_contact_char(char* ch);
|
||||
void prefs_clear_roster_contact_char(void);
|
||||
char prefs_get_roster_resource_char(void);
|
||||
void prefs_set_roster_resource_char(char ch);
|
||||
char* prefs_get_roster_resource_char(void);
|
||||
void prefs_set_roster_resource_char(char* ch);
|
||||
void prefs_clear_roster_resource_char(void);
|
||||
char prefs_get_roster_private_char(void);
|
||||
void prefs_set_roster_private_char(char ch);
|
||||
char* prefs_get_roster_private_char(void);
|
||||
void prefs_set_roster_private_char(char* ch);
|
||||
void prefs_clear_roster_private_char(void);
|
||||
char prefs_get_roster_room_char(void);
|
||||
void prefs_set_roster_room_char(char ch);
|
||||
char* prefs_get_roster_room_char(void);
|
||||
void prefs_set_roster_room_char(char* ch);
|
||||
void prefs_clear_roster_room_char(void);
|
||||
char prefs_get_roster_room_private_char(void);
|
||||
void prefs_set_roster_room_private_char(char ch);
|
||||
char* prefs_get_roster_room_private_char(void);
|
||||
void prefs_set_roster_room_private_char(char* ch);
|
||||
void prefs_clear_roster_room_private_char(void);
|
||||
char prefs_get_occupants_char(void);
|
||||
void prefs_set_occupants_char(char ch);
|
||||
char* prefs_get_occupants_char(void);
|
||||
void prefs_set_occupants_char(char* ch);
|
||||
void prefs_clear_occupants_char(void);
|
||||
char prefs_get_occupants_header_char(void);
|
||||
void prefs_set_occupants_header_char(char ch);
|
||||
char* prefs_get_occupants_header_char(void);
|
||||
void prefs_set_occupants_header_char(char* ch);
|
||||
void prefs_clear_occupants_header_char(void);
|
||||
|
||||
gint prefs_get_roster_contact_indent(void);
|
||||
|
@ -406,40 +406,40 @@ _load_preferences(void)
|
||||
// with custom set functions
|
||||
if (g_key_file_has_key(theme, "ui", "occupants.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "occupants.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_occupants_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_occupants_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_key_file_has_key(theme, "ui", "occupants.header.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "occupants.header.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_occupants_header_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_occupants_header_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_key_file_has_key(theme, "ui", "roster.header.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "roster.header.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_roster_header_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_roster_header_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_key_file_has_key(theme, "ui", "roster.contact.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "roster.contact.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_roster_contact_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_roster_contact_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_key_file_has_key(theme, "ui", "roster.resource.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "roster.resource.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_roster_resource_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_roster_resource_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
} else {
|
||||
@ -448,24 +448,24 @@ _load_preferences(void)
|
||||
|
||||
if (g_key_file_has_key(theme, "ui", "roster.rooms.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "roster.rooms.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_roster_room_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_roster_room_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_key_file_has_key(theme, "ui", "roster.rooms.private.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "roster.rooms.private.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_roster_room_private_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_roster_room_private_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_key_file_has_key(theme, "ui", "roster.private.char", NULL)) {
|
||||
gchar* ch = g_key_file_get_string(theme, "ui", "roster.private.char", NULL);
|
||||
if (ch && strlen(ch) > 0) {
|
||||
prefs_set_roster_private_char(ch[0]);
|
||||
if (ch && g_utf8_strlen(ch, 4) == 1) {
|
||||
prefs_set_roster_private_char(ch);
|
||||
g_free(ch);
|
||||
}
|
||||
}
|
||||
|
@ -1340,11 +1340,13 @@ cons_occupants_setting(void)
|
||||
else
|
||||
cons_show("Occupants wrap (/occupants) : OFF");
|
||||
|
||||
char occupants_ch = prefs_get_occupants_char();
|
||||
if (occupants_ch)
|
||||
cons_show("Occupants char (/occupants) : %c", occupants_ch);
|
||||
else
|
||||
char* occupants_ch = prefs_get_occupants_char();
|
||||
if (occupants_ch) {
|
||||
cons_show("Occupants char (/occupants) : %s", occupants_ch);
|
||||
free(occupants_ch);
|
||||
} else {
|
||||
cons_show("Occupants char (/occupants) : none");
|
||||
}
|
||||
|
||||
gint occupant_indent = prefs_get_occupants_indent();
|
||||
cons_show("Occupant indent (/occupants) : %d", occupant_indent);
|
||||
@ -1352,11 +1354,13 @@ cons_occupants_setting(void)
|
||||
int size = prefs_get_occupants_size();
|
||||
cons_show("Occupants size (/occupants) : %d", size);
|
||||
|
||||
char header_ch = prefs_get_occupants_header_char();
|
||||
if (header_ch)
|
||||
cons_show("Occupants header char (/occupants) : %c", header_ch);
|
||||
else
|
||||
char* header_ch = prefs_get_occupants_header_char();
|
||||
if (header_ch) {
|
||||
cons_show("Occupants header char (/occupants) : %s", header_ch);
|
||||
free(header_ch);
|
||||
} else {
|
||||
cons_show("Occupants header char (/occupants) : none");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -1475,41 +1479,53 @@ cons_roster_setting(void)
|
||||
else
|
||||
cons_show("Roster offline (/roster) : hide");
|
||||
|
||||
char header_ch = prefs_get_roster_header_char();
|
||||
if (header_ch)
|
||||
cons_show("Roster header char (/roster) : %c", header_ch);
|
||||
else
|
||||
char* header_ch = prefs_get_roster_header_char();
|
||||
if (header_ch) {
|
||||
cons_show("Roster header char (/roster) : %s", header_ch);
|
||||
free(header_ch);
|
||||
} else {
|
||||
cons_show("Roster header char (/roster) : none");
|
||||
}
|
||||
|
||||
char contact_ch = prefs_get_roster_contact_char();
|
||||
if (contact_ch)
|
||||
cons_show("Roster contact char (/roster) : %c", contact_ch);
|
||||
else
|
||||
char* contact_ch = prefs_get_roster_contact_char();
|
||||
if (contact_ch) {
|
||||
cons_show("Roster contact char (/roster) : %s", contact_ch);
|
||||
free(contact_ch);
|
||||
} else {
|
||||
cons_show("Roster contact char (/roster) : none");
|
||||
}
|
||||
|
||||
char resource_ch = prefs_get_roster_resource_char();
|
||||
if (resource_ch)
|
||||
cons_show("Roster resource char (/roster) : %c", resource_ch);
|
||||
else
|
||||
char* resource_ch = prefs_get_roster_resource_char();
|
||||
if (resource_ch) {
|
||||
cons_show("Roster resource char (/roster) : %s", resource_ch);
|
||||
free(resource_ch);
|
||||
} else {
|
||||
cons_show("Roster resource char (/roster) : none");
|
||||
}
|
||||
|
||||
char room_ch = prefs_get_roster_room_char();
|
||||
if (room_ch)
|
||||
cons_show("Roster room char (/roster) : %c", room_ch);
|
||||
else
|
||||
char* room_ch = prefs_get_roster_room_char();
|
||||
if (room_ch) {
|
||||
cons_show("Roster room char (/roster) : %s", room_ch);
|
||||
free(room_ch);
|
||||
} else {
|
||||
cons_show("Roster room char (/roster) : none");
|
||||
}
|
||||
|
||||
char room_priv_ch = prefs_get_roster_room_private_char();
|
||||
if (room_priv_ch)
|
||||
cons_show("Roster room private char (/roster) : %c", room_priv_ch);
|
||||
else
|
||||
char* room_priv_ch = prefs_get_roster_room_private_char();
|
||||
if (room_priv_ch) {
|
||||
cons_show("Roster room private char (/roster) : %s", room_priv_ch);
|
||||
free(room_priv_ch);
|
||||
} else {
|
||||
cons_show("Roster room private char (/roster) : none");
|
||||
}
|
||||
|
||||
char private_ch = prefs_get_roster_private_char();
|
||||
if (private_ch)
|
||||
cons_show("Roster private char (/roster) : %c", private_ch);
|
||||
else
|
||||
char* private_ch = prefs_get_roster_private_char();
|
||||
if (private_ch) {
|
||||
cons_show("Roster private char (/roster) : %s", private_ch);
|
||||
free(private_ch);
|
||||
} else {
|
||||
cons_show("Roster private char (/roster) : none");
|
||||
}
|
||||
|
||||
gint contact_indent = prefs_get_roster_contact_indent();
|
||||
cons_show("Roster contact indent (/roster) : %d", contact_indent);
|
||||
|
@ -77,9 +77,10 @@ _occuptantswin_occupant(ProfLayoutSplit* layout, GList* item, gboolean showjid,
|
||||
|
||||
GString* msg = g_string_new(spaces->str);
|
||||
|
||||
char ch = prefs_get_occupants_char();
|
||||
char* ch = prefs_get_occupants_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(msg, "%c", ch);
|
||||
g_string_append_printf(msg, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
gboolean wrap = prefs_get_boolean(PREF_OCCUPANTS_WRAP);
|
||||
@ -130,9 +131,10 @@ occupantswin_occupants(const char* const roomjid)
|
||||
|
||||
GString* prefix = g_string_new(" ");
|
||||
|
||||
char ch = prefs_get_occupants_header_char();
|
||||
char* ch = prefs_get_occupants_header_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(prefix, "%c", ch);
|
||||
g_string_append_printf(prefix, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) {
|
||||
|
@ -314,9 +314,10 @@ _rosterwin_unsubscribed_item(ProfLayoutSplit* layout, ProfChatWin* chatwin)
|
||||
indent--;
|
||||
}
|
||||
}
|
||||
char ch = prefs_get_roster_contact_char();
|
||||
char *ch = prefs_get_roster_contact_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(msg, "%c", ch);
|
||||
g_string_append_printf(msg, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
char* unreadpos = prefs_get_string(PREF_ROSTER_UNREAD);
|
||||
@ -376,9 +377,10 @@ _rosterwin_contact(ProfLayoutSplit* layout, PContact contact)
|
||||
indent--;
|
||||
}
|
||||
}
|
||||
char ch = prefs_get_roster_contact_char();
|
||||
char *ch = prefs_get_roster_contact_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(msg, "%c", ch);
|
||||
g_string_append_printf(msg, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
char* unreadpos = prefs_get_string(PREF_ROSTER_UNREAD);
|
||||
@ -527,9 +529,10 @@ _rosterwin_resources(ProfLayoutSplit* layout, PContact contact, int current_inde
|
||||
|
||||
wattron(layout->subwin, theme_attrs(resource_presence_colour));
|
||||
GString* msg = g_string_new("");
|
||||
char ch = prefs_get_roster_resource_char();
|
||||
char* ch = prefs_get_roster_resource_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(msg, "%c", ch);
|
||||
g_string_append_printf(msg, "%s", ch);
|
||||
free(ch);
|
||||
} else {
|
||||
g_string_append(msg, " ");
|
||||
}
|
||||
@ -590,9 +593,10 @@ _rosterwin_resources(ProfLayoutSplit* layout, PContact contact, int current_inde
|
||||
g_string_append(msg, " ");
|
||||
this_indent--;
|
||||
}
|
||||
char ch = prefs_get_roster_resource_char();
|
||||
char* ch = prefs_get_roster_resource_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(msg, "%c", ch);
|
||||
g_string_append_printf(msg, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
g_string_append(msg, resource->name);
|
||||
if (prefs_get_boolean(PREF_ROSTER_PRIORITY)) {
|
||||
@ -752,9 +756,10 @@ _rosterwin_room(ProfLayoutSplit* layout, ProfMucWin* mucwin)
|
||||
indent--;
|
||||
}
|
||||
}
|
||||
char ch = prefs_get_roster_room_char();
|
||||
char* ch = prefs_get_roster_room_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(msg, "%c", ch);
|
||||
g_string_append_printf(msg, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
char* unreadpos = prefs_get_string(PREF_ROSTER_ROOMS_UNREAD);
|
||||
@ -854,7 +859,8 @@ _rosterwin_room(ProfLayoutSplit* layout, ProfMucWin* mucwin)
|
||||
|
||||
ch = prefs_get_roster_room_private_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(privmsg, "%c", ch);
|
||||
g_string_append_printf(privmsg, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
char* nick = privwin->fulljid + strlen(mucwin->roomjid) + 1;
|
||||
@ -947,9 +953,10 @@ _rosterwin_private_chats(ProfLayoutSplit* layout, GList* orphaned_privchats)
|
||||
g_string_append_printf(privmsg, "(%d) ", privwin->unread);
|
||||
}
|
||||
|
||||
char ch = prefs_get_roster_private_char();
|
||||
char* ch = prefs_get_roster_private_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(privmsg, "%c", ch);
|
||||
g_string_append_printf(privmsg, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
g_string_append(privmsg, privwin->fulljid);
|
||||
@ -1028,9 +1035,10 @@ _rosterwin_unsubscribed_header(ProfLayoutSplit* layout, GList* wins)
|
||||
win_sub_newline_lazy(layout->subwin);
|
||||
|
||||
GString* header = g_string_new(" ");
|
||||
char ch = prefs_get_roster_header_char();
|
||||
char* ch = prefs_get_roster_header_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(header, "%c", ch);
|
||||
g_string_append_printf(header, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
g_string_append(header, "Unsubscribed");
|
||||
@ -1074,9 +1082,10 @@ _rosterwin_contacts_header(ProfLayoutSplit* layout, const char* const title, GSL
|
||||
win_sub_newline_lazy(layout->subwin);
|
||||
|
||||
GString* header = g_string_new(" ");
|
||||
char ch = prefs_get_roster_header_char();
|
||||
char* ch = prefs_get_roster_header_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(header, "%c", ch);
|
||||
g_string_append_printf(header, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
|
||||
g_string_append(header, title);
|
||||
@ -1125,9 +1134,10 @@ _rosterwin_rooms_header(ProfLayoutSplit* layout, GList* rooms, char* title)
|
||||
{
|
||||
win_sub_newline_lazy(layout->subwin);
|
||||
GString* header = g_string_new(" ");
|
||||
char ch = prefs_get_roster_header_char();
|
||||
char* ch = prefs_get_roster_header_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(header, "%c", ch);
|
||||
g_string_append_printf(header, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
g_string_append(header, title);
|
||||
|
||||
@ -1188,9 +1198,10 @@ _rosterwin_private_header(ProfLayoutSplit* layout, GList* privs)
|
||||
win_sub_newline_lazy(layout->subwin);
|
||||
|
||||
GString* title_str = g_string_new(" ");
|
||||
char ch = prefs_get_roster_header_char();
|
||||
char* ch = prefs_get_roster_header_char();
|
||||
if (ch) {
|
||||
g_string_append_printf(title_str, "%c", ch);
|
||||
g_string_append_printf(title_str, "%s", ch);
|
||||
free(ch);
|
||||
}
|
||||
g_string_append(title_str, "Private chats");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user