merge: sync upstream profanity-im/profanity
All checks were successful
CI Code / Check spelling (push) Successful in 18s
CI Code / Check coding style (push) Successful in 34s
CI Code / Code Coverage (push) Successful in 2m36s
CI Code / Linux (debian) (push) Successful in 4m41s
CI Code / Linux (ubuntu) (push) Successful in 4m52s
CI Code / Linux (arch) (push) Successful in 5m40s
All checks were successful
CI Code / Check spelling (push) Successful in 18s
CI Code / Check coding style (push) Successful in 34s
CI Code / Code Coverage (push) Successful in 2m36s
CI Code / Linux (debian) (push) Successful in 4m41s
CI Code / Linux (ubuntu) (push) Successful in 4m52s
CI Code / Linux (arch) (push) Successful in 5m40s
Sync with upstream profanity-im/profanity.
Major upstream changes incorporated:
Memory management
- Replace malloc+memset with g_new0 throughout codebase
- Adopt auto_gchar / auto_gcharv / auto_gerror / auto_jid cleanup macros
- Replace free() with g_free() for GAlloc'd memory
Editor rewrite
- Remove pthread-based async editor; use GChildWatch callback API
- New launch_editor(initial_content, callback, user_data) interface
- Proper signal handling (SIGINT, SIGTSTP, SIGPIPE reset in child)
- ui_suspend()/ui_resume() integration for TTY management
OMEMO improvements
- Dual backend support: libsignal-protocol-c and libomemo-c
- Proper pre-key removal after use (XEP-0384 compliance)
- Automatic pre-key regeneration when store drops below threshold
- New functions: omemo_is_device_active(), omemo_is_jid_trusted()
- omemo_get_jid_untrusted_fingerprints() for better error messages
- Fingerprint notifications on new device identity discovery
- Deterministic pre-key ID generation tracking max_pre_key_id
- omemo_trust_changed() UI updates on trust state changes
JID validation
- RFC 6122-compliant validation in jid_is_valid()
- Character-level checks (RFC 6122 forbidden chars: & ' / : < > @)
- Length limits: 1023 per component, 3071 total
- New jid_is_valid_user_jid() for user vs. service JID distinction
Database
- Schema migration v3: UNIQUE constraint on archive_id for deduplication
- Triggers for corrected message tracking (replaces_db_id / replaced_by_db_id)
- db_history_result_t return type, _truncate_datetime_suffix()
UI / console
- win_warn_needed() / win_warn_sent() warning deduplication hash table
- PAD_MIN_HEIGHT dynamic pad sizing with PAD_THRESHOLD auto-cleanup
- Spellcheck integration in input field with Unicode word detection
- cons_spellcheck_setting() for /settings ui output
- /[command]? shortcut for command help
Account config
- Account name sanitization for GKeyFile special chars ([ ] = # \n \r)
- Replace popen() with g_spawn_sync() for eval_password
- TLS policy: add "direct" option alongside legacy
Connection
- Port validation with g_assert (0–65535)
- SHA-256 certificate fingerprint support (XMPP_CERT_PUBKEY_FINGERPRINT_SHA256)
- "direct" TLS policy alias for legacy SSL
Common utilities
- str_xml_sanitize() for XML 1.0 illegal character removal
- string_matches_one_of() with formatted error messages
- valid_tls_policy_option() helper
- prof_date_time_format_iso8601() utility
- Improved strip_arg_quotes() with backslash unescaping
- prof_occurrences() uses g_slist_prepend + reverse for performance
PGP / OX
- Proper GPGME resource cleanup with goto-cleanup pattern
- g_string_free(xmppuri) leak fix in _ox_key_lookup
CSV export
- Use GString + g_file_set_contents instead of raw write() syscalls
Tests
- Restructured into subdirectories: command/, config/, xmpp/, ui/, omemo/, otr/, pgp/
- New test_cmd_ac.c for autocompleter unit tests
- Updated stubs for new UI suspend/resume functions
License headers
- Migrate to SPDX-3.0 identifiers (GPL-3.0-or-later WITH OpenSSL-exception)
────────────────────────────────────────────────────
cproof-specific preservations:
- XEP-0308 LMC: replace_id ?: id logic in message/stanza/omemo
- Force encryption: cmd_force_encryption, test_forced_encryption
- CWE-134: format string protection (cons_show("%s", ...))
- y_start_pos-based paging in window.c
- db_history_result_t return type, _truncate_datetime_suffix()
Merge-time fixes:
- common.c: format-security (-Werror) — cons_show(errmsg) → cons_show("%s", errmsg)
- database.c: null-deref guard — !msg->timestamp → msg && !msg->timestamp
- console.c: implicit size_t → int cast — (int)(maxlen + 1)
- tlscerts.c: %d for size_t — %zu
Build system:
- Kept autotools (Makefile.am, configure.ac); upstream uses Meson
- Restored deleted files: bootstrap.sh, autogen.sh, ax_valgrind_check.m4, configure-debug
- Updated Makefile.am test paths for subdirectory structure
- Added test_cmd_ac, test_forced_encryption to test sources
Functional tests:
- Use cproof version; upstream requires stbbr_for_xmlns from updated stabber
- Not yet available in devs/stabber fork
Closes #64
Merge author: jabber.developer2
Commits authors:
Michael Vetter <jubalh@iodoru.org>
& Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
395
src/ui/console.c
395
src/ui/console.c
@@ -3,35 +3,9 @@
|
||||
* vim: expandtab:ts=4:sts=4:sw=4
|
||||
*
|
||||
* Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
|
||||
* Copyright (C) 2019 - 2025 Michael Vetter <jubalh@iodoru.org>
|
||||
*
|
||||
* This file is part of Profanity.
|
||||
*
|
||||
* Profanity is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Profanity is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Profanity. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link the code of portions of this program with the OpenSSL library under
|
||||
* certain conditions as described in each individual source file, and
|
||||
* distribute linked combinations including the two.
|
||||
*
|
||||
* You must obey the GNU General Public License in all respects for all of the
|
||||
* code used other than OpenSSL. If you modify file(s) with this exception, you
|
||||
* may extend this exception to your version of the file(s), but you are not
|
||||
* obligated to do so. If you do not wish to do so, delete this exception
|
||||
* statement from your version. If you delete this exception statement from all
|
||||
* source files in the program, then also delete it here.
|
||||
* Copyright (C) 2019 - 2026 Michael Vetter <jubalh@iodoru.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -90,6 +64,13 @@ cons_show(const char* const msg, ...)
|
||||
va_end(arg);
|
||||
}
|
||||
|
||||
#define cons_show_if_set(fmt, elmnt) \
|
||||
do { \
|
||||
if (elmnt) { \
|
||||
cons_show(fmt, elmnt); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void
|
||||
cons_show_padded(int pad, const char* const msg, ...)
|
||||
{
|
||||
@@ -110,9 +91,12 @@ cons_show_help(const char* const cmd, CommandHelp* help)
|
||||
cons_show("");
|
||||
win_println(console, THEME_HELP_HEADER, "-", "%s", &cmd[1]);
|
||||
win_print(console, THEME_HELP_HEADER, "-", "");
|
||||
int i;
|
||||
for (i = 0; i < strlen(cmd) - 1; i++) {
|
||||
win_append(console, THEME_HELP_HEADER, "-");
|
||||
size_t i;
|
||||
size_t cmd_len = strlen(cmd);
|
||||
if (cmd_len > 0) {
|
||||
for (i = 0; i < cmd_len - 1; i++) {
|
||||
win_append(console, THEME_HELP_HEADER, "-");
|
||||
}
|
||||
}
|
||||
win_appendln(console, THEME_HELP_HEADER, "");
|
||||
cons_show("");
|
||||
@@ -124,7 +108,7 @@ cons_show_help(const char* const cmd, CommandHelp* help)
|
||||
win_println(console, THEME_HELP_HEADER, "-", "Description");
|
||||
win_println(console, THEME_DEFAULT, "-", "%s", help->desc);
|
||||
|
||||
int maxlen = 0;
|
||||
size_t maxlen = 0;
|
||||
for (i = 0; help->args[i][0] != NULL; i++) {
|
||||
if (strlen(help->args[i][0]) > maxlen)
|
||||
maxlen = strlen(help->args[i][0]);
|
||||
@@ -134,7 +118,7 @@ cons_show_help(const char* const cmd, CommandHelp* help)
|
||||
cons_show("");
|
||||
win_println(console, THEME_HELP_HEADER, "-", "Arguments");
|
||||
for (i = 0; help->args[i][0] != NULL; i++) {
|
||||
win_println_indent(console, maxlen + 3, "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]);
|
||||
win_println_indent(console, (int)(maxlen + 3), "%-*s: %s", (int)(maxlen + 1), help->args[i][0], help->args[i][1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,8 +162,8 @@ cons_show_tlscert_summary(const TLSCertificate* cert)
|
||||
return;
|
||||
}
|
||||
|
||||
cons_show("Subject : %s", cert->subject_commonname);
|
||||
cons_show("Issuer : %s", cert->issuer_commonname);
|
||||
cons_show("Subject : %s", cert->subject.commonname);
|
||||
cons_show("Issuer : %s", cert->issuer.commonname);
|
||||
cons_show("Fingerprint : %s", cert->fingerprint);
|
||||
}
|
||||
|
||||
@@ -192,75 +176,39 @@ cons_show_tlscert(const TLSCertificate* cert)
|
||||
|
||||
cons_show("Certificate:");
|
||||
|
||||
cons_show(" Subject:");
|
||||
if (cert->subject_commonname) {
|
||||
cons_show(" Common name : %s", cert->subject_commonname);
|
||||
}
|
||||
if (cert->subject_distinguishedname) {
|
||||
cons_show(" Distinguished name : %s", cert->subject_distinguishedname);
|
||||
}
|
||||
if (cert->subject_organisation) {
|
||||
cons_show(" Organisation : %s", cert->subject_organisation);
|
||||
}
|
||||
if (cert->subject_organisation_unit) {
|
||||
cons_show(" Organisation unit : %s", cert->subject_organisation_unit);
|
||||
}
|
||||
if (cert->subject_email) {
|
||||
cons_show(" Email : %s", cert->subject_email);
|
||||
}
|
||||
if (cert->subject_state) {
|
||||
cons_show(" State : %s", cert->subject_state);
|
||||
}
|
||||
if (cert->subject_country) {
|
||||
cons_show(" Country : %s", cert->subject_country);
|
||||
}
|
||||
if (cert->subject_serialnumber) {
|
||||
cons_show(" Serial number : %s", cert->subject_serialnumber);
|
||||
}
|
||||
|
||||
cons_show(" Issuer:");
|
||||
if (cert->issuer_commonname) {
|
||||
cons_show(" Common name : %s", cert->issuer_commonname);
|
||||
}
|
||||
if (cert->issuer_distinguishedname) {
|
||||
cons_show(" Distinguished name : %s", cert->issuer_distinguishedname);
|
||||
}
|
||||
if (cert->issuer_organisation) {
|
||||
cons_show(" Organisation : %s", cert->issuer_organisation);
|
||||
}
|
||||
if (cert->issuer_organisation_unit) {
|
||||
cons_show(" Organisation unit : %s", cert->issuer_organisation_unit);
|
||||
}
|
||||
if (cert->issuer_email) {
|
||||
cons_show(" Email : %s", cert->issuer_email);
|
||||
}
|
||||
if (cert->issuer_state) {
|
||||
cons_show(" State : %s", cert->issuer_state);
|
||||
}
|
||||
if (cert->issuer_country) {
|
||||
cons_show(" Country : %s", cert->issuer_country);
|
||||
}
|
||||
if (cert->issuer_serialnumber) {
|
||||
cons_show(" Serial number : %s", cert->issuer_serialnumber);
|
||||
}
|
||||
|
||||
cons_show(" Version : %d", cert->version);
|
||||
|
||||
if (cert->serialnumber) {
|
||||
cons_show(" Serial number : %s", cert->serialnumber);
|
||||
}
|
||||
cons_show(" Subject:");
|
||||
cons_show_if_set(" Common name : %s", cert->subject.commonname);
|
||||
cons_show_if_set(" Distinguished name : %s", cert->subject.distinguishedname);
|
||||
cons_show_if_set(" Organisation : %s", cert->subject.organisation);
|
||||
cons_show_if_set(" Organisation unit : %s", cert->subject.organisation_unit);
|
||||
cons_show_if_set(" Email : %s", cert->subject.email);
|
||||
cons_show_if_set(" State : %s", cert->subject.state);
|
||||
cons_show_if_set(" Country : %s", cert->subject.country);
|
||||
cons_show_if_set(" Serial number : %s", cert->subject.serialnumber);
|
||||
|
||||
if (cert->key_alg) {
|
||||
cons_show(" Key algorithm : %s", cert->key_alg);
|
||||
}
|
||||
if (cert->signature_alg) {
|
||||
cons_show(" Signature algorithm : %s", cert->signature_alg);
|
||||
}
|
||||
cons_show(" Issuer:");
|
||||
cons_show_if_set(" Common name : %s", cert->issuer.commonname);
|
||||
cons_show_if_set(" Distinguished name : %s", cert->issuer.distinguishedname);
|
||||
cons_show_if_set(" Organisation : %s", cert->issuer.organisation);
|
||||
cons_show_if_set(" Organisation unit : %s", cert->issuer.organisation_unit);
|
||||
cons_show_if_set(" Email : %s", cert->issuer.email);
|
||||
cons_show_if_set(" State : %s", cert->issuer.state);
|
||||
cons_show_if_set(" Country : %s", cert->issuer.country);
|
||||
cons_show_if_set(" Serial number : %s", cert->issuer.serialnumber);
|
||||
|
||||
cons_show(" Start : %s", cert->notbefore);
|
||||
cons_show(" End : %s", cert->notafter);
|
||||
cons_show_if_set(" Serial number : %s", cert->serialnumber);
|
||||
|
||||
cons_show(" Fingerprint : %s", cert->fingerprint);
|
||||
cons_show_if_set(" Key algorithm : %s", cert->key_alg);
|
||||
cons_show_if_set(" Signature algorithm : %s", cert->signature_alg);
|
||||
|
||||
cons_show_if_set(" Validity Start : %s", cert->notbefore);
|
||||
cons_show_if_set(" Validity End : %s", cert->notafter);
|
||||
|
||||
cons_show_if_set(" Fingerprint SHA1 : %s", cert->fingerprint_sha1);
|
||||
cons_show_if_set(" Fingerprint SHA256 : %s", cert->fingerprint_sha256);
|
||||
cons_show_if_set(" Pubkey Fingerprint : %s", cert->pubkey_fingerprint);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -417,7 +365,7 @@ cons_check_version(gboolean not_available_msg)
|
||||
gboolean relase_valid = g_regex_match_simple("^\\d+\\.\\d+\\.\\d+$", latest_release, 0, 0);
|
||||
|
||||
if (relase_valid) {
|
||||
if (release_is_new(latest_release)) {
|
||||
if (release_is_new(PACKAGE_VERSION, latest_release)) {
|
||||
win_println(console, THEME_DEFAULT, "-", "A new version of Profanity is available: %s", latest_release);
|
||||
win_println(console, THEME_DEFAULT, "-", "Check <https://profanity-im.github.io> for details.");
|
||||
win_println(console, THEME_DEFAULT, "-", "");
|
||||
@@ -470,7 +418,7 @@ cons_show_wins(gboolean unread)
|
||||
|
||||
GSList* curr = window_strings;
|
||||
while (curr) {
|
||||
if (g_strstr_len((char*)curr->data, strlen((char*)curr->data), " unread") != NULL) {
|
||||
if (g_strstr_len(curr->data, strlen(curr->data), " unread") != NULL) {
|
||||
win_println(console, THEME_CMD_WINS_UNREAD, "-", "%s", (char*)curr->data);
|
||||
} else {
|
||||
win_println(console, THEME_DEFAULT, "-", "%s", (char*)curr->data);
|
||||
@@ -483,7 +431,7 @@ cons_show_wins(gboolean unread)
|
||||
}
|
||||
|
||||
void
|
||||
cons_show_wins_attention()
|
||||
cons_show_wins_attention(void)
|
||||
{
|
||||
ProfWin* console = wins_get_console();
|
||||
cons_show("");
|
||||
@@ -491,7 +439,7 @@ cons_show_wins_attention()
|
||||
|
||||
GSList* curr = window_strings;
|
||||
while (curr) {
|
||||
if (g_strstr_len((char*)curr->data, strlen((char*)curr->data), " unread") != NULL) {
|
||||
if (g_strstr_len(curr->data, strlen(curr->data), " unread") != NULL) {
|
||||
win_println(console, THEME_CMD_WINS_UNREAD, "-", "%s", (char*)curr->data);
|
||||
} else {
|
||||
win_println(console, THEME_DEFAULT, "-", "%s", (char*)curr->data);
|
||||
@@ -845,7 +793,7 @@ cons_show_qrcode(const char* const text)
|
||||
static const size_t ZOOM_SIZE = 10;
|
||||
QRcode* qrcode = QRcode_encodeString(text, 0, QR_ECLEVEL_L, QR_MODE_8, 1);
|
||||
|
||||
int width = (qrcode->width * ZOOM_SIZE);
|
||||
size_t width = (qrcode->width * ZOOM_SIZE);
|
||||
unsigned char* data = qrcode->data;
|
||||
|
||||
ProfWin* console = wins_get_console();
|
||||
@@ -857,7 +805,7 @@ cons_show_qrcode(const char* const text)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < width + 2 * ZOOM_SIZE; i += ZOOM_SIZE) {
|
||||
for (size_t i = 0; i < width + 2 * ZOOM_SIZE; i += ZOOM_SIZE) {
|
||||
strcat(pad, "\u2588\u2588");
|
||||
}
|
||||
|
||||
@@ -1318,6 +1266,21 @@ cons_splash_setting(void)
|
||||
cons_show("Splash screen (/splash) : OFF");
|
||||
}
|
||||
|
||||
void
|
||||
cons_spellcheck_setting(void)
|
||||
{
|
||||
#ifdef HAVE_SPELLCHECK
|
||||
if (prefs_get_boolean(PREF_SPELLCHECK_ENABLE)) {
|
||||
auto_gchar gchar* lang = prefs_get_string(PREF_SPELLCHECK_LANG);
|
||||
cons_show("Spellcheck (/spellcheck) : ON (%s)", lang);
|
||||
} else {
|
||||
cons_show("Spellcheck (/spellcheck) : OFF");
|
||||
}
|
||||
#else
|
||||
cons_show("Spellcheck (/spellcheck) : built without spellcheck support");
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
cons_occupants_setting(void)
|
||||
{
|
||||
@@ -1341,7 +1304,7 @@ cons_occupants_setting(void)
|
||||
else
|
||||
cons_show("Occupants wrap (/occupants) : OFF");
|
||||
|
||||
auto_char char* occupants_ch = prefs_get_occupants_char();
|
||||
auto_gchar gchar* occupants_ch = prefs_get_occupants_char();
|
||||
if (occupants_ch) {
|
||||
cons_show("Occupants char (/occupants) : %s", occupants_ch);
|
||||
} else {
|
||||
@@ -1354,7 +1317,7 @@ cons_occupants_setting(void)
|
||||
int size = prefs_get_occupants_size();
|
||||
cons_show("Occupants size (/occupants) : %d", size);
|
||||
|
||||
auto_char char* header_ch = prefs_get_occupants_header_char();
|
||||
auto_gchar gchar* header_ch = prefs_get_occupants_header_char();
|
||||
if (header_ch) {
|
||||
cons_show("Occupants header char (/occupants) : %s", header_ch);
|
||||
} else {
|
||||
@@ -1471,42 +1434,42 @@ cons_roster_setting(void)
|
||||
else
|
||||
cons_show("Roster offline (/roster) : hide");
|
||||
|
||||
auto_char char* header_ch = prefs_get_roster_header_char();
|
||||
auto_gchar gchar* header_ch = prefs_get_roster_header_char();
|
||||
if (header_ch) {
|
||||
cons_show("Roster header char (/roster) : %s", header_ch);
|
||||
} else {
|
||||
cons_show("Roster header char (/roster) : none");
|
||||
}
|
||||
|
||||
auto_char char* contact_ch = prefs_get_roster_contact_char();
|
||||
auto_gchar gchar* contact_ch = prefs_get_roster_contact_char();
|
||||
if (contact_ch) {
|
||||
cons_show("Roster contact char (/roster) : %s", contact_ch);
|
||||
} else {
|
||||
cons_show("Roster contact char (/roster) : none");
|
||||
}
|
||||
|
||||
auto_char char* resource_ch = prefs_get_roster_resource_char();
|
||||
auto_gchar gchar* resource_ch = prefs_get_roster_resource_char();
|
||||
if (resource_ch) {
|
||||
cons_show("Roster resource char (/roster) : %s", resource_ch);
|
||||
} else {
|
||||
cons_show("Roster resource char (/roster) : none");
|
||||
}
|
||||
|
||||
auto_char char* room_ch = prefs_get_roster_room_char();
|
||||
auto_gchar gchar* room_ch = prefs_get_roster_room_char();
|
||||
if (room_ch) {
|
||||
cons_show("Roster room char (/roster) : %s", room_ch);
|
||||
} else {
|
||||
cons_show("Roster room char (/roster) : none");
|
||||
}
|
||||
|
||||
auto_char char* room_priv_ch = prefs_get_roster_room_private_char();
|
||||
auto_gchar gchar* room_priv_ch = prefs_get_roster_room_private_char();
|
||||
if (room_priv_ch) {
|
||||
cons_show("Roster room private char (/roster) : %s", room_priv_ch);
|
||||
} else {
|
||||
cons_show("Roster room private char (/roster) : none");
|
||||
}
|
||||
|
||||
auto_char char* private_ch = prefs_get_roster_private_char();
|
||||
auto_gchar gchar* private_ch = prefs_get_roster_private_char();
|
||||
if (private_ch) {
|
||||
cons_show("Roster private char (/roster) : %s", private_ch);
|
||||
} else {
|
||||
@@ -1637,6 +1600,7 @@ cons_show_ui_prefs(void)
|
||||
cons_beep_setting();
|
||||
cons_flash_setting();
|
||||
cons_splash_setting();
|
||||
cons_spellcheck_setting();
|
||||
cons_winpos_setting();
|
||||
cons_wrap_setting();
|
||||
cons_time_setting();
|
||||
@@ -2378,6 +2342,7 @@ cons_help(void)
|
||||
cons_show_padded(pad, "/help commands ui : List commands for manipulating the user interface.");
|
||||
cons_show_padded(pad, "/help commands plugins : List plugin commands.");
|
||||
cons_show_padded(pad, "/help [command] : Detailed help on a specific command.");
|
||||
cons_show_padded(pad, "/[command]? : Shortcut to get detailed help on a specific command.");
|
||||
cons_show_padded(pad, "/help navigation : How to navigate around Profanity.");
|
||||
cons_show("");
|
||||
|
||||
@@ -2494,137 +2459,123 @@ cons_get_string(ProfConsoleWin* conswin)
|
||||
return g_strdup("Console");
|
||||
}
|
||||
|
||||
void
|
||||
_cons_theme_bar_prop(theme_item_t theme, char* prop)
|
||||
static void
|
||||
_cons_theme_bar_prop(ProfWin* console, theme_item_t theme, char* prop)
|
||||
{
|
||||
ProfWin* console = wins_get_console();
|
||||
auto_gchar gchar* propstr = g_strdup_printf("%-24s", prop);
|
||||
win_print(console, THEME_TEXT, "-", "%s", propstr);
|
||||
|
||||
GString* propstr = g_string_new(" ");
|
||||
g_string_append_printf(propstr, "%-24s", prop);
|
||||
win_print(console, THEME_TEXT, "-", "%s", propstr->str);
|
||||
g_string_free(propstr, TRUE);
|
||||
|
||||
GString* valstr = g_string_new(" ");
|
||||
char* setting = theme_get_string(prop);
|
||||
g_string_append_printf(valstr, "%s ", setting);
|
||||
theme_free_string(setting);
|
||||
win_append(console, theme, "%s", valstr->str);
|
||||
auto_gchar gchar* setting = theme_get_string(prop);
|
||||
win_append(console, theme, "%s", setting);
|
||||
win_appendln(console, THEME_TEXT, "");
|
||||
g_string_free(valstr, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
_cons_theme_prop(theme_item_t theme, char* prop)
|
||||
static void
|
||||
_cons_theme_prop(ProfWin* console, theme_item_t theme, char* prop)
|
||||
{
|
||||
ProfWin* console = wins_get_console();
|
||||
auto_gchar gchar* propstr = g_strdup_printf("%-24s", prop);
|
||||
win_print(console, THEME_TEXT, "-", "%s", propstr);
|
||||
|
||||
GString* propstr = g_string_new(" ");
|
||||
g_string_append_printf(propstr, "%-24s", prop);
|
||||
win_print(console, THEME_TEXT, "-", "%s", propstr->str);
|
||||
g_string_free(propstr, TRUE);
|
||||
|
||||
GString* valstr = g_string_new("");
|
||||
char* setting = theme_get_string(prop);
|
||||
g_string_append_printf(valstr, "%s", setting);
|
||||
theme_free_string(setting);
|
||||
win_appendln(console, theme, "%s", valstr->str);
|
||||
g_string_free(valstr, TRUE);
|
||||
auto_gchar gchar* setting = theme_get_string(prop);
|
||||
win_appendln(console, theme, "%s", setting);
|
||||
}
|
||||
|
||||
void
|
||||
cons_theme_properties(void)
|
||||
{
|
||||
ProfWin* console = wins_get_console();
|
||||
cons_show("Current colours:");
|
||||
_cons_theme_bar_prop(THEME_TITLE_TEXT, "titlebar.text");
|
||||
_cons_theme_bar_prop(THEME_TITLE_BRACKET, "titlebar.brackets");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_TEXT, "titlebar.text");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_BRACKET, "titlebar.brackets");
|
||||
|
||||
_cons_theme_bar_prop(THEME_TITLE_SCROLLED, "titlebar.scrolled");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_SCROLLED, "titlebar.scrolled");
|
||||
|
||||
_cons_theme_bar_prop(THEME_TITLE_UNENCRYPTED, "titlebar.unencrypted");
|
||||
_cons_theme_bar_prop(THEME_TITLE_ENCRYPTED, "titlebar.encrypted");
|
||||
_cons_theme_bar_prop(THEME_TITLE_UNTRUSTED, "titlebar.untrusted");
|
||||
_cons_theme_bar_prop(THEME_TITLE_TRUSTED, "titlebar.trusted");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_UNENCRYPTED, "titlebar.unencrypted");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_ENCRYPTED, "titlebar.encrypted");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_UNTRUSTED, "titlebar.untrusted");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_TRUSTED, "titlebar.trusted");
|
||||
|
||||
_cons_theme_bar_prop(THEME_TITLE_CHAT, "titlebar.chat");
|
||||
_cons_theme_bar_prop(THEME_TITLE_ONLINE, "titlebar.online");
|
||||
_cons_theme_bar_prop(THEME_TITLE_AWAY, "titlebar.away");
|
||||
_cons_theme_bar_prop(THEME_TITLE_XA, "titlebar.xa");
|
||||
_cons_theme_bar_prop(THEME_TITLE_DND, "titlebar.dnd");
|
||||
_cons_theme_bar_prop(THEME_TITLE_OFFLINE, "titlebar.offline");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_CHAT, "titlebar.chat");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_ONLINE, "titlebar.online");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_AWAY, "titlebar.away");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_XA, "titlebar.xa");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_DND, "titlebar.dnd");
|
||||
_cons_theme_bar_prop(console, THEME_TITLE_OFFLINE, "titlebar.offline");
|
||||
|
||||
_cons_theme_bar_prop(THEME_STATUS_TEXT, "statusbar.text");
|
||||
_cons_theme_bar_prop(THEME_STATUS_BRACKET, "statusbar.brackets");
|
||||
_cons_theme_bar_prop(THEME_STATUS_ACTIVE, "statusbar.active");
|
||||
_cons_theme_bar_prop(THEME_STATUS_CURRENT, "statusbar.current");
|
||||
_cons_theme_bar_prop(THEME_STATUS_NEW, "statusbar.new");
|
||||
_cons_theme_bar_prop(THEME_STATUS_TIME, "statusbar.time");
|
||||
_cons_theme_bar_prop(console, THEME_STATUS_TEXT, "statusbar.text");
|
||||
_cons_theme_bar_prop(console, THEME_STATUS_BRACKET, "statusbar.brackets");
|
||||
_cons_theme_bar_prop(console, THEME_STATUS_ACTIVE, "statusbar.active");
|
||||
_cons_theme_bar_prop(console, THEME_STATUS_CURRENT, "statusbar.current");
|
||||
_cons_theme_bar_prop(console, THEME_STATUS_NEW, "statusbar.new");
|
||||
_cons_theme_bar_prop(console, THEME_STATUS_TIME, "statusbar.time");
|
||||
|
||||
_cons_theme_prop(THEME_TIME, "main.time");
|
||||
_cons_theme_prop(THEME_TEXT, "main.text");
|
||||
_cons_theme_prop(THEME_SPLASH, "main.splash");
|
||||
_cons_theme_prop(THEME_ERROR, "error");
|
||||
_cons_theme_prop(THEME_OTR_STARTED_TRUSTED, "otr.started.trusted");
|
||||
_cons_theme_prop(THEME_OTR_STARTED_UNTRUSTED, "otr.started.untrusted");
|
||||
_cons_theme_prop(THEME_OTR_ENDED, "otr.ended");
|
||||
_cons_theme_prop(THEME_OTR_TRUSTED, "otr.trusted");
|
||||
_cons_theme_prop(THEME_OTR_UNTRUSTED, "otr.untrusted");
|
||||
_cons_theme_prop(console, THEME_TIME, "main.time");
|
||||
_cons_theme_prop(console, THEME_TEXT, "main.text");
|
||||
_cons_theme_prop(console, THEME_SPLASH, "main.splash");
|
||||
_cons_theme_prop(console, THEME_ERROR, "error");
|
||||
_cons_theme_prop(console, THEME_OTR_STARTED_TRUSTED, "otr.started.trusted");
|
||||
_cons_theme_prop(console, THEME_OTR_STARTED_UNTRUSTED, "otr.started.untrusted");
|
||||
_cons_theme_prop(console, THEME_OTR_ENDED, "otr.ended");
|
||||
_cons_theme_prop(console, THEME_OTR_TRUSTED, "otr.trusted");
|
||||
_cons_theme_prop(console, THEME_OTR_UNTRUSTED, "otr.untrusted");
|
||||
|
||||
_cons_theme_prop(THEME_ME, "me");
|
||||
_cons_theme_prop(THEME_TEXT_ME, "main.text.me");
|
||||
_cons_theme_prop(THEME_THEM, "them");
|
||||
_cons_theme_prop(THEME_TEXT_THEM, "main.text.them");
|
||||
_cons_theme_prop(THEME_TEXT_HISTORY, "main.text.history");
|
||||
_cons_theme_prop(console, THEME_ME, "me");
|
||||
_cons_theme_prop(console, THEME_TEXT_ME, "main.text.me");
|
||||
_cons_theme_prop(console, THEME_THEM, "them");
|
||||
_cons_theme_prop(console, THEME_TEXT_THEM, "main.text.them");
|
||||
_cons_theme_prop(console, THEME_TEXT_HISTORY, "main.text.history");
|
||||
|
||||
_cons_theme_prop(THEME_CHAT, "chat");
|
||||
_cons_theme_prop(THEME_ONLINE, "online");
|
||||
_cons_theme_prop(THEME_AWAY, "away");
|
||||
_cons_theme_prop(THEME_XA, "xa");
|
||||
_cons_theme_prop(THEME_DND, "dnd");
|
||||
_cons_theme_prop(THEME_OFFLINE, "offline");
|
||||
_cons_theme_prop(THEME_SUBSCRIBED, "subscribed");
|
||||
_cons_theme_prop(THEME_UNSUBSCRIBED, "unsubscribed");
|
||||
_cons_theme_prop(console, THEME_CHAT, "chat");
|
||||
_cons_theme_prop(console, THEME_ONLINE, "online");
|
||||
_cons_theme_prop(console, THEME_AWAY, "away");
|
||||
_cons_theme_prop(console, THEME_XA, "xa");
|
||||
_cons_theme_prop(console, THEME_DND, "dnd");
|
||||
_cons_theme_prop(console, THEME_OFFLINE, "offline");
|
||||
_cons_theme_prop(console, THEME_SUBSCRIBED, "subscribed");
|
||||
_cons_theme_prop(console, THEME_UNSUBSCRIBED, "unsubscribed");
|
||||
|
||||
_cons_theme_prop(THEME_INCOMING, "incoming");
|
||||
_cons_theme_prop(THEME_MENTION, "mention");
|
||||
_cons_theme_prop(THEME_TRIGGER, "trigger");
|
||||
_cons_theme_prop(THEME_TYPING, "typing");
|
||||
_cons_theme_prop(THEME_GONE, "gone");
|
||||
_cons_theme_prop(console, THEME_INCOMING, "incoming");
|
||||
_cons_theme_prop(console, THEME_MENTION, "mention");
|
||||
_cons_theme_prop(console, THEME_TRIGGER, "trigger");
|
||||
_cons_theme_prop(console, THEME_TYPING, "typing");
|
||||
_cons_theme_prop(console, THEME_GONE, "gone");
|
||||
|
||||
_cons_theme_prop(THEME_ROOMINFO, "roominfo");
|
||||
_cons_theme_prop(THEME_ROOMMENTION, "roommention");
|
||||
_cons_theme_prop(THEME_ROOMMENTION_TERM, "roommention.term");
|
||||
_cons_theme_prop(THEME_ROOMTRIGGER, "roomtrigger");
|
||||
_cons_theme_prop(THEME_ROOMTRIGGER_TERM, "roomtrigger.term");
|
||||
_cons_theme_prop(console, THEME_ROOMINFO, "roominfo");
|
||||
_cons_theme_prop(console, THEME_ROOMMENTION, "roommention");
|
||||
_cons_theme_prop(console, THEME_ROOMMENTION_TERM, "roommention.term");
|
||||
_cons_theme_prop(console, THEME_ROOMTRIGGER, "roomtrigger");
|
||||
_cons_theme_prop(console, THEME_ROOMTRIGGER_TERM, "roomtrigger.term");
|
||||
|
||||
_cons_theme_prop(THEME_ROSTER_HEADER, "roster.header");
|
||||
_cons_theme_prop(THEME_ROSTER_CHAT, "roster.chat");
|
||||
_cons_theme_prop(THEME_ROSTER_ONLINE, "roster.online");
|
||||
_cons_theme_prop(THEME_ROSTER_AWAY, "roster.away");
|
||||
_cons_theme_prop(THEME_ROSTER_XA, "roster.xa");
|
||||
_cons_theme_prop(THEME_ROSTER_DND, "roster.dnd");
|
||||
_cons_theme_prop(THEME_ROSTER_OFFLINE, "roster.offline");
|
||||
_cons_theme_prop(THEME_ROSTER_CHAT_ACTIVE, "roster.chat.active");
|
||||
_cons_theme_prop(THEME_ROSTER_ONLINE_ACTIVE, "roster.online.active");
|
||||
_cons_theme_prop(THEME_ROSTER_AWAY_ACTIVE, "roster.away.active");
|
||||
_cons_theme_prop(THEME_ROSTER_XA_ACTIVE, "roster.xa.active");
|
||||
_cons_theme_prop(THEME_ROSTER_DND_ACTIVE, "roster.dnd.active");
|
||||
_cons_theme_prop(THEME_ROSTER_OFFLINE_ACTIVE, "roster.offline.active");
|
||||
_cons_theme_prop(THEME_ROSTER_CHAT_UNREAD, "roster.chat.unread");
|
||||
_cons_theme_prop(THEME_ROSTER_ONLINE_UNREAD, "roster.online.unread");
|
||||
_cons_theme_prop(THEME_ROSTER_AWAY_UNREAD, "roster.away.unread");
|
||||
_cons_theme_prop(THEME_ROSTER_XA_UNREAD, "roster.xa.unread");
|
||||
_cons_theme_prop(THEME_ROSTER_DND_UNREAD, "roster.dnd.unread");
|
||||
_cons_theme_prop(THEME_ROSTER_OFFLINE_UNREAD, "roster.offline.unread");
|
||||
_cons_theme_prop(THEME_ROSTER_ROOM, "roster.room");
|
||||
_cons_theme_prop(THEME_ROSTER_ROOM_UNREAD, "roster.room.unread");
|
||||
_cons_theme_prop(THEME_ROSTER_ROOM_TRIGGER, "roster.room.trigger");
|
||||
_cons_theme_prop(THEME_ROSTER_ROOM_MENTION, "roster.room.mention");
|
||||
_cons_theme_prop(console, THEME_ROSTER_HEADER, "roster.header");
|
||||
_cons_theme_prop(console, THEME_ROSTER_CHAT, "roster.chat");
|
||||
_cons_theme_prop(console, THEME_ROSTER_ONLINE, "roster.online");
|
||||
_cons_theme_prop(console, THEME_ROSTER_AWAY, "roster.away");
|
||||
_cons_theme_prop(console, THEME_ROSTER_XA, "roster.xa");
|
||||
_cons_theme_prop(console, THEME_ROSTER_DND, "roster.dnd");
|
||||
_cons_theme_prop(console, THEME_ROSTER_OFFLINE, "roster.offline");
|
||||
_cons_theme_prop(console, THEME_ROSTER_CHAT_ACTIVE, "roster.chat.active");
|
||||
_cons_theme_prop(console, THEME_ROSTER_ONLINE_ACTIVE, "roster.online.active");
|
||||
_cons_theme_prop(console, THEME_ROSTER_AWAY_ACTIVE, "roster.away.active");
|
||||
_cons_theme_prop(console, THEME_ROSTER_XA_ACTIVE, "roster.xa.active");
|
||||
_cons_theme_prop(console, THEME_ROSTER_DND_ACTIVE, "roster.dnd.active");
|
||||
_cons_theme_prop(console, THEME_ROSTER_OFFLINE_ACTIVE, "roster.offline.active");
|
||||
_cons_theme_prop(console, THEME_ROSTER_CHAT_UNREAD, "roster.chat.unread");
|
||||
_cons_theme_prop(console, THEME_ROSTER_ONLINE_UNREAD, "roster.online.unread");
|
||||
_cons_theme_prop(console, THEME_ROSTER_AWAY_UNREAD, "roster.away.unread");
|
||||
_cons_theme_prop(console, THEME_ROSTER_XA_UNREAD, "roster.xa.unread");
|
||||
_cons_theme_prop(console, THEME_ROSTER_DND_UNREAD, "roster.dnd.unread");
|
||||
_cons_theme_prop(console, THEME_ROSTER_OFFLINE_UNREAD, "roster.offline.unread");
|
||||
_cons_theme_prop(console, THEME_ROSTER_ROOM, "roster.room");
|
||||
_cons_theme_prop(console, THEME_ROSTER_ROOM_UNREAD, "roster.room.unread");
|
||||
_cons_theme_prop(console, THEME_ROSTER_ROOM_TRIGGER, "roster.room.trigger");
|
||||
_cons_theme_prop(console, THEME_ROSTER_ROOM_MENTION, "roster.room.mention");
|
||||
|
||||
_cons_theme_prop(THEME_OCCUPANTS_HEADER, "occupants.header");
|
||||
_cons_theme_prop(console, THEME_OCCUPANTS_HEADER, "occupants.header");
|
||||
|
||||
_cons_theme_prop(THEME_RECEIPT_SENT, "receipt.sent");
|
||||
_cons_theme_prop(console, THEME_RECEIPT_SENT, "receipt.sent");
|
||||
|
||||
_cons_theme_prop(THEME_INPUT_TEXT, "input.text");
|
||||
_cons_theme_prop(console, THEME_INPUT_TEXT, "input.text");
|
||||
_cons_theme_prop(console, THEME_INPUT_MISSPELLED, "input.misspelled");
|
||||
|
||||
cons_show("");
|
||||
}
|
||||
@@ -2786,7 +2737,7 @@ cons_show_bookmarks_ignore(gchar** list, gsize len)
|
||||
cons_show("");
|
||||
cons_show("Ignored bookmarks:");
|
||||
|
||||
for (int i = 0; i < len; i++) {
|
||||
for (gsize i = 0; i < len; i++) {
|
||||
win_print(console, THEME_DEFAULT, "-", " %s", list[i]);
|
||||
win_newline(console);
|
||||
}
|
||||
@@ -2839,13 +2790,15 @@ cons_strophe_setting(void)
|
||||
}
|
||||
}
|
||||
cons_show("XEP-0198 Stream-Management : %s", sm_setting);
|
||||
cons_show("libstrophe Verbosity : %s", prefs_get_string(PREF_STROPHE_VERBOSITY));
|
||||
auto_gchar gchar* verbosity = prefs_get_string(PREF_STROPHE_VERBOSITY);
|
||||
cons_show("libstrophe Verbosity : %s", verbosity);
|
||||
}
|
||||
|
||||
void
|
||||
cons_privacy_setting(void)
|
||||
{
|
||||
cons_show("Database logging : %s", prefs_get_string(PREF_DBLOG));
|
||||
auto_gchar gchar* dblog = prefs_get_string(PREF_DBLOG);
|
||||
cons_show("Database logging : %s", dblog);
|
||||
|
||||
if (prefs_get_boolean(PREF_HISTORY)) {
|
||||
cons_show("Chat history (/history) : ON");
|
||||
|
||||
Reference in New Issue
Block a user