mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Apply codigng style on new MAM code
This commit is contained in:
parent
5ebd7df7e8
commit
a04031cec9
@ -59,7 +59,7 @@ static struct color_pair_cache
|
||||
struct
|
||||
{
|
||||
int16_t fg, bg;
|
||||
} * pairs;
|
||||
}* pairs;
|
||||
int size;
|
||||
int capacity;
|
||||
} cache = { 0 };
|
||||
|
@ -635,7 +635,7 @@ win_page_up(ProfWin* window)
|
||||
*page_start -= page_space;
|
||||
|
||||
if (*page_start == -page_space && window->type == WIN_CHAT) {
|
||||
ProfChatWin* chatwin = (ProfChatWin*) window;
|
||||
ProfChatWin* chatwin = (ProfChatWin*)window;
|
||||
ProfBuffEntry* first_entry = buffer_size(window->layout->buffer) != 0 ? buffer_get_entry(window->layout->buffer, 0) : NULL;
|
||||
|
||||
// Don't do anything if still fetching mam messages
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include "xmpp/contact.h"
|
||||
#include "xmpp/muc.h"
|
||||
|
||||
#define PAD_SIZE 1000
|
||||
#define PAD_SIZE 1000
|
||||
#define LOADING_MESSAGE "Loading older messages ..."
|
||||
|
||||
void win_move_to_end(ProfWin* window);
|
||||
|
@ -2707,7 +2707,6 @@ iq_mam_request(ProfChatWin* win, GDateTime* enddate)
|
||||
late_delivery_windows = g_slist_append(late_delivery_windows, cur_del_data);
|
||||
}
|
||||
|
||||
|
||||
_iq_mam_request(win, startdate, enddate);
|
||||
|
||||
return;
|
||||
@ -2731,13 +2730,13 @@ _mam_rsm_id_handler(xmpp_stanza_t* const stanza, void* const userdata)
|
||||
|
||||
buffer_remove_entry(window->layout->buffer, 0);
|
||||
|
||||
char *start_str = NULL;
|
||||
char* start_str = NULL;
|
||||
if (data->start_datestr) {
|
||||
start_str = strdup(data->start_datestr);
|
||||
// Convert to iso8601
|
||||
start_str[strlen(start_str) - 3] = '\0';
|
||||
}
|
||||
char *end_str = NULL;
|
||||
char* end_str = NULL;
|
||||
if (data->end_datestr) {
|
||||
end_str = strdup(data->end_datestr);
|
||||
// Convert to iso8601
|
||||
@ -2762,7 +2761,8 @@ _mam_rsm_id_handler(xmpp_stanza_t* const stanza, void* const userdata)
|
||||
}
|
||||
|
||||
chatwin_db_history(data->win, start_str, end_str, TRUE);
|
||||
if (start_str) free(start_str);
|
||||
if (start_str)
|
||||
free(start_str);
|
||||
|
||||
xmpp_stanza_t* set = xmpp_stanza_get_child_by_name_and_ns(fin, STANZA_TYPE_SET, STANZA_NS_RSM);
|
||||
if (set) {
|
||||
|
@ -2767,7 +2767,7 @@ stanza_create_mam_iq(xmpp_ctx_t* ctx, const char* const jid, const char* const s
|
||||
xmpp_stanza_add_child(field_with, value_with);
|
||||
|
||||
// field 'start'
|
||||
xmpp_stanza_t* field_start, *value_start, *start_date_text;
|
||||
xmpp_stanza_t *field_start, *value_start, *start_date_text;
|
||||
if (startdate) {
|
||||
field_start = xmpp_stanza_new(ctx);
|
||||
xmpp_stanza_set_name(field_start, STANZA_NAME_FIELD);
|
||||
@ -2783,7 +2783,7 @@ stanza_create_mam_iq(xmpp_ctx_t* ctx, const char* const jid, const char* const s
|
||||
xmpp_stanza_add_child(field_start, value_start);
|
||||
}
|
||||
|
||||
xmpp_stanza_t* field_end, *value_end, *end_date_text;
|
||||
xmpp_stanza_t *field_end, *value_end, *end_date_text;
|
||||
if (enddate) {
|
||||
field_end = xmpp_stanza_new(ctx);
|
||||
xmpp_stanza_set_name(field_end, STANZA_NAME_FIELD);
|
||||
|
Loading…
Reference in New Issue
Block a user