mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Rename buffer->from to buffer->display_from
This commit is contained in:
parent
e27c414f1f
commit
fcfb493dfb
@ -82,7 +82,7 @@ buffer_free(ProfBuff buffer)
|
|||||||
|
|
||||||
void
|
void
|
||||||
buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *time,
|
buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *time,
|
||||||
int flags, theme_item_t theme_item, const char *const from, const char *const message, DeliveryReceipt *receipt, const char *const id)
|
int flags, theme_item_t theme_item, const char *const display_from, const char *const message, DeliveryReceipt *receipt, const char *const id)
|
||||||
{
|
{
|
||||||
ProfBuffEntry *e = malloc(sizeof(struct prof_buff_entry_t));
|
ProfBuffEntry *e = malloc(sizeof(struct prof_buff_entry_t));
|
||||||
e->show_char = show_char;
|
e->show_char = show_char;
|
||||||
@ -90,7 +90,7 @@ buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *
|
|||||||
e->flags = flags;
|
e->flags = flags;
|
||||||
e->theme_item = theme_item;
|
e->theme_item = theme_item;
|
||||||
e->time = g_date_time_ref(time);
|
e->time = g_date_time_ref(time);
|
||||||
e->from = from ? strdup(from) : NULL;
|
e->display_from = display_from ? strdup(display_from) : NULL;
|
||||||
e->message = strdup(message);
|
e->message = strdup(message);
|
||||||
e->receipt = receipt;
|
e->receipt = receipt;
|
||||||
if (id) {
|
if (id) {
|
||||||
@ -164,7 +164,7 @@ static void
|
|||||||
_free_entry(ProfBuffEntry *entry)
|
_free_entry(ProfBuffEntry *entry)
|
||||||
{
|
{
|
||||||
free(entry->message);
|
free(entry->message);
|
||||||
free(entry->from);
|
free(entry->display_from);
|
||||||
free(entry->id);
|
free(entry->id);
|
||||||
free(entry->receipt);
|
free(entry->receipt);
|
||||||
g_date_time_unref(entry->time);
|
g_date_time_unref(entry->time);
|
||||||
|
@ -52,7 +52,9 @@ typedef struct prof_buff_entry_t {
|
|||||||
GDateTime *time;
|
GDateTime *time;
|
||||||
int flags;
|
int flags;
|
||||||
theme_item_t theme_item;
|
theme_item_t theme_item;
|
||||||
char *from;
|
// from as it is displayed
|
||||||
|
// might be nick, jid..
|
||||||
|
char *display_from;
|
||||||
char *message;
|
char *message;
|
||||||
DeliveryReceipt *receipt;
|
DeliveryReceipt *receipt;
|
||||||
// message id, in case we have it
|
// message id, in case we have it
|
||||||
@ -64,7 +66,7 @@ typedef struct prof_buff_t *ProfBuff;
|
|||||||
ProfBuff buffer_create();
|
ProfBuff buffer_create();
|
||||||
void buffer_free(ProfBuff buffer);
|
void buffer_free(ProfBuff buffer);
|
||||||
void buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *time,
|
void buffer_append(ProfBuff buffer, const char show_char, int pad_indent, GDateTime *time,
|
||||||
int flags, theme_item_t theme_item, const char *const from, const char *const message, DeliveryReceipt *receipt, const char *const id);
|
int flags, theme_item_t theme_item, const char *const display_from, const char *const message, DeliveryReceipt *receipt, const char *const id);
|
||||||
void buffer_remove_entry_by_id(ProfBuff buffer, const char *const id);
|
void buffer_remove_entry_by_id(ProfBuff buffer, const char *const id);
|
||||||
int buffer_size(ProfBuff buffer);
|
int buffer_size(ProfBuff buffer);
|
||||||
ProfBuffEntry* buffer_get_entry(ProfBuff buffer, int entry);
|
ProfBuffEntry* buffer_get_entry(ProfBuff buffer, int entry);
|
||||||
|
@ -1098,7 +1098,7 @@ _win_correct(ProfWin *window, const char *const message, const char *const id, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
win_print_incoming(ProfWin *window, const char *const from, ProfMessage *message)
|
win_print_incoming(ProfWin *window, const char *const display_name_from, ProfMessage *message)
|
||||||
{
|
{
|
||||||
char enc_char = '-';
|
char enc_char = '-';
|
||||||
int flags = NO_ME;
|
int flags = NO_ME;
|
||||||
@ -1125,12 +1125,12 @@ win_print_incoming(ProfWin *window, const char *const from, ProfMessage *message
|
|||||||
if (prefs_get_boolean(PREF_CORRECTION_ALLOW) && message->replace_id) {
|
if (prefs_get_boolean(PREF_CORRECTION_ALLOW) && message->replace_id) {
|
||||||
_win_correct(window, message->plain, message->id, message->replace_id);
|
_win_correct(window, message->plain, message->id, message->replace_id);
|
||||||
} else {
|
} else {
|
||||||
_win_printf(window, enc_char, 0, message->timestamp, flags, THEME_TEXT_THEM, from, message->id, "%s", message->plain);
|
_win_printf(window, enc_char, 0, message->timestamp, flags, THEME_TEXT_THEM, display_name_from, message->id, "%s", message->plain);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WIN_PRIVATE:
|
case WIN_PRIVATE:
|
||||||
_win_printf(window, '-', 0, message->timestamp, flags, THEME_TEXT_THEM, from, message->id, "%s", message->plain);
|
_win_printf(window, '-', 0, message->timestamp, flags, THEME_TEXT_THEM, display_name_from, message->id, "%s", message->plain);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(FALSE);
|
assert(FALSE);
|
||||||
@ -1743,12 +1743,12 @@ win_redraw(ProfWin *window)
|
|||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
ProfBuffEntry *e = buffer_get_entry(window->layout->buffer, i);
|
ProfBuffEntry *e = buffer_get_entry(window->layout->buffer, i);
|
||||||
|
|
||||||
if (e->from == NULL && e->message && e->message[0] == '-') {
|
if (e->display_from == NULL && e->message && e->message[0] == '-') {
|
||||||
// just an indicator to print the separator not the actual message
|
// just an indicator to print the separator not the actual message
|
||||||
win_print_separator(window);
|
win_print_separator(window);
|
||||||
} else {
|
} else {
|
||||||
// regular thing to print
|
// regular thing to print
|
||||||
_win_print_internal(window, e->show_char, e->pad_indent, e->time, e->flags, e->theme_item, e->from, e->message, e->receipt);
|
_win_print_internal(window, e->show_char, e->pad_indent, e->time, e->flags, e->theme_item, e->display_from, e->message, e->receipt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user