style: apply clang-format and const qualifiers from master
All checks were successful
CI Code / Check spelling (pull_request) Successful in 21s
CI Code / Check coding style (pull_request) Successful in 37s
CI Code / Code Coverage (pull_request) Successful in 7m12s
CI Code / Linux (ubuntu) (pull_request) Successful in 8m37s
CI Code / Linux (debian) (pull_request) Successful in 8m37s
CI Code / Linux (arch) (pull_request) Successful in 8m55s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 21s
CI Code / Check coding style (pull_request) Successful in 37s
CI Code / Code Coverage (pull_request) Successful in 7m12s
CI Code / Linux (ubuntu) (pull_request) Successful in 8m37s
CI Code / Linux (debian) (pull_request) Successful in 8m37s
CI Code / Linux (arch) (pull_request) Successful in 8m55s
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
static sqlite3* g_chatlog_database;
|
static sqlite3* g_chatlog_database;
|
||||||
|
|
||||||
static void _add_to_db(ProfMessage* message, char* type, const Jid* const from_jid, const Jid* const to_jid);
|
static void _add_to_db(ProfMessage* message, const char* type, const Jid* const from_jid, const Jid* const to_jid);
|
||||||
static char* _get_db_filename(ProfAccount* account);
|
static char* _get_db_filename(ProfAccount* account);
|
||||||
static prof_msg_type_t _get_message_type_type(const char* const type);
|
static prof_msg_type_t _get_message_type_type(const char* const type);
|
||||||
static prof_enc_t _get_message_enc_type(const char* const encstr);
|
static prof_enc_t _get_message_enc_type(const char* const encstr);
|
||||||
@@ -147,7 +147,7 @@ _sqlite_init(ProfAccount* account)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* query = "CREATE TABLE IF NOT EXISTS `ChatLogs` ("
|
const char* query = "CREATE TABLE IF NOT EXISTS `ChatLogs` ("
|
||||||
"`id` INTEGER PRIMARY KEY AUTOINCREMENT, "
|
"`id` INTEGER PRIMARY KEY AUTOINCREMENT, "
|
||||||
"`from_jid` TEXT NOT NULL, "
|
"`from_jid` TEXT NOT NULL, "
|
||||||
"`to_jid` TEXT NOT NULL, "
|
"`to_jid` TEXT NOT NULL, "
|
||||||
@@ -251,7 +251,7 @@ _sqlite_add_incoming(ProfMessage* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_log_database_add_outgoing(char* type, const char* const id, const char* const barejid, const char* const message, const char* const replace_id, prof_enc_t enc)
|
_log_database_add_outgoing(const char* type, const char* const id, const char* const barejid, const char* const message, const char* const replace_id, prof_enc_t enc)
|
||||||
{
|
{
|
||||||
ProfMessage* msg = message_init();
|
ProfMessage* msg = message_init();
|
||||||
|
|
||||||
@@ -350,8 +350,8 @@ _sqlite_get_previous_chat(const gchar* const contact_barejid, const gchar* start
|
|||||||
return DB_RESPONSE_ERROR;
|
return DB_RESPONSE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar* sort1 = from_start ? "ASC" : "DESC";
|
const gchar* sort1 = from_start ? "ASC" : "DESC";
|
||||||
gchar* sort2 = !flip ? "ASC" : "DESC";
|
const gchar* sort2 = !flip ? "ASC" : "DESC";
|
||||||
GDateTime* now = g_date_time_new_now_local();
|
GDateTime* now = g_date_time_new_now_local();
|
||||||
auto_gchar gchar* end_date_fmt = end_time ? g_strdup(end_time) : g_date_time_format_iso8601(now);
|
auto_gchar gchar* end_date_fmt = end_time ? g_strdup(end_time) : g_date_time_format_iso8601(now);
|
||||||
auto_sqlite gchar* query = sqlite3_mprintf("SELECT * FROM ("
|
auto_sqlite gchar* query = sqlite3_mprintf("SELECT * FROM ("
|
||||||
@@ -571,7 +571,7 @@ _get_message_enc_type(const char* const encstr)
|
|||||||
// --- Core write logic ---
|
// --- Core write logic ---
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_add_to_db(ProfMessage* message, char* type, const Jid* const from_jid, const Jid* const to_jid)
|
_add_to_db(ProfMessage* message, const char* type, const Jid* const from_jid, const Jid* const to_jid)
|
||||||
{
|
{
|
||||||
auto_gchar gchar* pref_dblog = prefs_get_string(PREF_DBLOG);
|
auto_gchar gchar* pref_dblog = prefs_get_string(PREF_DBLOG);
|
||||||
sqlite_int64 original_message_id = -1;
|
sqlite_int64 original_message_id = -1;
|
||||||
|
|||||||
@@ -268,7 +268,8 @@ main(int argc, char* argv[])
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Test group registry for easy extension */
|
/* Test group registry for easy extension */
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
const char* name;
|
const char* name;
|
||||||
const struct CMUnitTest* tests;
|
const struct CMUnitTest* tests;
|
||||||
size_t count;
|
size_t count;
|
||||||
|
|||||||
@@ -504,13 +504,11 @@ prof_connect_with_roster(const char *roster)
|
|||||||
{
|
{
|
||||||
GString* roster_str = g_string_new(
|
GString* roster_str = g_string_new(
|
||||||
"<iq type='result' to='stabber@localhost/profanity'>"
|
"<iq type='result' to='stabber@localhost/profanity'>"
|
||||||
"<query xmlns='jabber:iq:roster' ver='362'>"
|
"<query xmlns='jabber:iq:roster' ver='362'>");
|
||||||
);
|
|
||||||
g_string_append(roster_str, roster);
|
g_string_append(roster_str, roster);
|
||||||
g_string_append(roster_str,
|
g_string_append(roster_str,
|
||||||
"</query>"
|
"</query>"
|
||||||
"</iq>"
|
"</iq>");
|
||||||
);
|
|
||||||
|
|
||||||
stbbr_for_query("jabber:iq:roster", roster_str->str);
|
stbbr_for_query("jabber:iq:roster", roster_str->str);
|
||||||
g_string_free(roster_str, TRUE);
|
g_string_free(roster_str, TRUE);
|
||||||
@@ -535,8 +533,7 @@ prof_connect_with_roster(const char *roster)
|
|||||||
assert_true(stbbr_received(
|
assert_true(stbbr_received(
|
||||||
"<presence id=\"*\">"
|
"<presence id=\"*\">"
|
||||||
"<c xmlns=\"http://jabber.org/protocol/caps\" hash=\"sha-1\" node=\"http://profanity-im.github.io\" ver=\"*\"/>"
|
"<c xmlns=\"http://jabber.org/protocol/caps\" hash=\"sha-1\" node=\"http://profanity-im.github.io\" ver=\"*\"/>"
|
||||||
"</presence>"
|
"</presence>"));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -556,6 +553,5 @@ prof_connect(void)
|
|||||||
{
|
{
|
||||||
prof_connect_with_roster(
|
prof_connect_with_roster(
|
||||||
"<item jid='buddy1@localhost' subscription='both' name='Buddy1'/>"
|
"<item jid='buddy1@localhost' subscription='both' name='Buddy1'/>"
|
||||||
"<item jid='buddy2@localhost' subscription='both' name='Buddy2'/>"
|
"<item jid='buddy2@localhost' subscription='both' name='Buddy2'/>");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,8 @@ message_db_history_long_message(void **state)
|
|||||||
"<message id='long1' to='stabber@localhost' "
|
"<message id='long1' to='stabber@localhost' "
|
||||||
"from='buddy1@localhost/phone' type='chat'>"
|
"from='buddy1@localhost/phone' type='chat'>"
|
||||||
"<body>%s</body>"
|
"<body>%s</body>"
|
||||||
"</message>", body);
|
"</message>",
|
||||||
|
body);
|
||||||
stbbr_send(xml);
|
stbbr_send(xml);
|
||||||
|
|
||||||
assert_true(prof_output_exact("<< chat message: Buddy1/phone (win 2)"));
|
assert_true(prof_output_exact("<< chat message: Buddy1/phone (win 2)"));
|
||||||
|
|||||||
Reference in New Issue
Block a user