Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements #1942

Merged
merged 8 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,405 changes: 1,320 additions & 85 deletions prof.supp

Large diffs are not rendered by default.

27 changes: 12 additions & 15 deletions src/chatlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,15 @@ void
chat_log_msg_out(const char* const barejid, const char* const msg, const char* const resource)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
_chat_log_chat(mybarejid, barejid, msg, PROF_OUT_LOG, NULL, resource);
_chat_log_chat(connection_get_barejid(), barejid, msg, PROF_OUT_LOG, NULL, resource);
}
}

void
chat_log_otr_msg_out(const char* const barejid, const char* const msg, const char* const resource)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_otr_log = prefs_get_string(PREF_OTR_LOG);
if (strcmp(pref_otr_log, "on") == 0) {
_chat_log_chat(mybarejid, barejid, msg, PROF_OUT_LOG, NULL, resource);
Expand All @@ -108,7 +107,7 @@ void
chat_log_pgp_msg_out(const char* const barejid, const char* const msg, const char* const resource)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_pgp_log = prefs_get_string(PREF_PGP_LOG);
if (strcmp(pref_pgp_log, "on") == 0) {
_chat_log_chat(mybarejid, barejid, msg, PROF_OUT_LOG, NULL, resource);
Expand All @@ -122,7 +121,7 @@ void
chat_log_omemo_msg_out(const char* const barejid, const char* const msg, const char* const resource)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_omemo_log = prefs_get_string(PREF_OMEMO_LOG);
if (strcmp(pref_omemo_log, "on") == 0) {
_chat_log_chat(mybarejid, barejid, msg, PROF_OUT_LOG, NULL, resource);
Expand All @@ -136,7 +135,7 @@ void
chat_log_otr_msg_in(ProfMessage* message)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_otr_log = prefs_get_string(PREF_OTR_LOG);
if (message->enc == PROF_MSG_ENC_NONE || (strcmp(pref_otr_log, "on") == 0)) {
if (message->type == PROF_MSG_TYPE_MUCPM) {
Expand All @@ -158,7 +157,7 @@ void
chat_log_pgp_msg_in(ProfMessage* message)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_pgp_log = prefs_get_string(PREF_PGP_LOG);
if (strcmp(pref_pgp_log, "on") == 0) {
if (message->type == PROF_MSG_TYPE_MUCPM) {
Expand All @@ -180,7 +179,7 @@ void
chat_log_omemo_msg_in(ProfMessage* message)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_omemo_log = prefs_get_string(PREF_OMEMO_LOG);
if (strcmp(pref_omemo_log, "on") == 0) {
if (message->type == PROF_MSG_TYPE_MUCPM) {
Expand All @@ -202,7 +201,7 @@ void
chat_log_msg_in(ProfMessage* message)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();

if (message->type == PROF_MSG_TYPE_MUCPM) {
_chat_log_chat(mybarejid, message->from_jid->barejid, message->plain, PROF_IN_LOG, message->timestamp, message->from_jid->resourcepart);
Expand Down Expand Up @@ -308,26 +307,24 @@ void
groupchat_log_msg_out(const gchar* const room, const gchar* const msg)
{
if (prefs_get_boolean(PREF_GRLOG)) {
auto_char char* mybarejid = connection_get_barejid();
char* mynick = muc_nick(room);
_groupchat_log_chat(mybarejid, room, mynick, msg);
_groupchat_log_chat(connection_get_barejid(), room, mynick, msg);
}
}

void
groupchat_log_msg_in(const gchar* const room, const gchar* const nick, const gchar* const msg)
{
if (prefs_get_boolean(PREF_GRLOG)) {
auto_char char* mybarejid = connection_get_barejid();
_groupchat_log_chat(mybarejid, room, nick, msg);
_groupchat_log_chat(connection_get_barejid(), room, nick, msg);
}
}

void
groupchat_log_omemo_msg_out(const gchar* const room, const gchar* const msg)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_omemo_log = prefs_get_string(PREF_OMEMO_LOG);
char* mynick = muc_nick(room);

Expand All @@ -343,7 +340,7 @@ void
groupchat_log_omemo_msg_in(const gchar* const room, const gchar* const nick, const gchar* const msg)
{
if (prefs_get_boolean(PREF_CHLOG)) {
auto_char char* mybarejid = connection_get_barejid();
const char* mybarejid = connection_get_barejid();
auto_gchar gchar* pref_omemo_log = prefs_get_string(PREF_OMEMO_LOG);

if (strcmp(pref_omemo_log, "on") == 0) {
Expand Down
Loading
Loading