Compare commits
4 Commits
build/mult
...
130bb7d1a0
| Author | SHA1 | Date | |
|---|---|---|---|
| 130bb7d1a0 | |||
| 073ebfdb91 | |||
| 3cdd3846a8 | |||
|
4ee10d4b21
|
@@ -5,7 +5,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
autoconf \
|
||||
autoconf-archive \
|
||||
automake \
|
||||
ca-certificates \
|
||||
expect \
|
||||
gcc \
|
||||
git \
|
||||
@@ -37,7 +36,7 @@ RUN mkdir -p /usr/src/{stabber,libstrophe,profanity}
|
||||
WORKDIR /usr/src
|
||||
|
||||
#RUN git clone https://github.com/boothj5/stabber
|
||||
RUN git clone --depth 1 https://git.jabber.space/devs/libstrophe-gh.git libstrophe
|
||||
RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe
|
||||
|
||||
#WORKDIR /usr/src/stabber
|
||||
#RUN ./bootstrap.sh
|
||||
@@ -48,7 +47,7 @@ RUN git clone --depth 1 https://git.jabber.space/devs/libstrophe-gh.git libstrop
|
||||
WORKDIR /usr/src/libstrophe
|
||||
RUN ./bootstrap.sh
|
||||
RUN ./configure --prefix=/usr
|
||||
RUN make -j$(nproc)
|
||||
RUN make
|
||||
RUN make install
|
||||
|
||||
WORKDIR /usr/src/profanity
|
||||
|
||||
@@ -9,7 +9,6 @@ RUN dnf install -y \
|
||||
autoconf-archive \
|
||||
automake \
|
||||
awk \
|
||||
ca-certificates \
|
||||
expect-devel \
|
||||
gcc \
|
||||
git \
|
||||
@@ -57,11 +56,11 @@ WORKDIR /usr/src
|
||||
|
||||
WORKDIR /usr/src
|
||||
RUN mkdir -p /usr/src/libstrophe
|
||||
RUN git clone --depth 1 https://git.jabber.space/devs/libstrophe-gh.git libstrophe
|
||||
RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe
|
||||
WORKDIR /usr/src/libstrophe
|
||||
RUN ./bootstrap.sh
|
||||
RUN ./configure --prefix=/usr
|
||||
RUN make -j$(nproc)
|
||||
RUN make
|
||||
RUN make install
|
||||
|
||||
RUN mkdir -p /usr/src/profanity
|
||||
|
||||
@@ -6,7 +6,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
autoconf \
|
||||
autoconf-archive \
|
||||
automake \
|
||||
ca-certificates \
|
||||
expect \
|
||||
gcc \
|
||||
git \
|
||||
@@ -38,7 +37,7 @@ RUN mkdir -p /usr/src/{stabber,libstrophe,profanity}
|
||||
WORKDIR /usr/src
|
||||
|
||||
#RUN git clone https://github.com/boothj5/stabber
|
||||
RUN git clone --depth 1 https://git.jabber.space/devs/libstrophe-gh.git libstrophe
|
||||
RUN git clone -c http.sslverify=false https://github.com/strophe/libstrophe
|
||||
|
||||
# TODO: Re-enable once libmicrohttpd-dev has been updated.
|
||||
#WORKDIR /usr/src/stabber
|
||||
@@ -50,7 +49,7 @@ RUN git clone --depth 1 https://git.jabber.space/devs/libstrophe-gh.git libstrop
|
||||
WORKDIR /usr/src/libstrophe
|
||||
RUN ./bootstrap.sh
|
||||
RUN ./configure --prefix=/usr
|
||||
RUN make -j$(nproc)
|
||||
RUN make
|
||||
RUN make install
|
||||
|
||||
WORKDIR /usr/src/profanity
|
||||
|
||||
@@ -121,11 +121,11 @@ esac
|
||||
case "$ARCH" in
|
||||
linux*)
|
||||
echo
|
||||
echo "--> Building with ./configure -C ${tests[0]} --enable-valgrind $*"
|
||||
echo "--> Building with ./configure ${tests[0]} --enable-valgrind $*"
|
||||
echo
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
./configure -C ${tests[0]} --enable-valgrind $*
|
||||
./configure ${tests[0]} --enable-valgrind $*
|
||||
|
||||
$MAKE CC="${CC}"
|
||||
if grep '^ID=' /etc/os-release | grep -q -e debian; then
|
||||
@@ -140,11 +140,11 @@ esac
|
||||
for features in "${tests[@]}"
|
||||
do
|
||||
echo
|
||||
echo "--> Building with ./configure -C ${features} $*"
|
||||
echo "--> Building with ./configure ${features} $*"
|
||||
echo
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
./configure -C $features $*
|
||||
./configure $features $*
|
||||
|
||||
$MAKE CC="${CC}"
|
||||
$MAKE check
|
||||
|
||||
@@ -99,6 +99,7 @@ _buffer_add(ProfBuff buffer, const char* show_char, int pad_indent, GDateTime* t
|
||||
|
||||
// With 10% margin to ensure overflow prevention
|
||||
while (buffer->lines >= PAD_SIZE - (PAD_SIZE / 10) && g_slist_length(buffer->entries) > 1) {
|
||||
log_debug("DELETING");
|
||||
// Delete message from the opposite size to free buffer
|
||||
GSList* buffer_entry_to_delete = append ? buffer->entries : g_slist_last(buffer->entries);
|
||||
ProfBuffEntry* entry_to_delete = (ProfBuffEntry*)buffer_entry_to_delete->data;
|
||||
|
||||
@@ -268,7 +268,11 @@ _show_scrolled(ProfWin* current)
|
||||
wattroff(win, bracket_attrs);
|
||||
|
||||
wattron(win, scrolled_attrs);
|
||||
wprintw(win, "SCROLLED");
|
||||
if (current->layout->unread_msg == 0) {
|
||||
wprintw(win, "SCROLLED");
|
||||
} else {
|
||||
wprintw(win, "SCROLLED, NEW MESSAGES");
|
||||
}
|
||||
wattroff(win, scrolled_attrs);
|
||||
|
||||
wattron(win, bracket_attrs);
|
||||
|
||||
@@ -120,6 +120,7 @@ typedef struct prof_layout_t
|
||||
ProfBuff buffer;
|
||||
int y_pos;
|
||||
int paged;
|
||||
int unread_msg;
|
||||
} ProfLayout;
|
||||
|
||||
typedef struct prof_layout_simple_t
|
||||
|
||||
@@ -103,6 +103,7 @@ _win_create_simple_layout(void)
|
||||
layout->base.buffer = buffer_create();
|
||||
layout->base.y_pos = 0;
|
||||
layout->base.paged = 0;
|
||||
layout->base.unread_msg = 0;
|
||||
scrollok(layout->base.win, TRUE);
|
||||
|
||||
return &layout->base;
|
||||
@@ -120,6 +121,7 @@ _win_create_split_layout(void)
|
||||
layout->base.buffer = buffer_create();
|
||||
layout->base.y_pos = 0;
|
||||
layout->base.paged = 0;
|
||||
layout->base.unread_msg = 0;
|
||||
scrollok(layout->base.win, TRUE);
|
||||
layout->subwin = NULL;
|
||||
layout->sub_y_pos = 0;
|
||||
@@ -197,6 +199,7 @@ win_create_muc(const char* const roomjid)
|
||||
layout->base.buffer = buffer_create();
|
||||
layout->base.y_pos = 0;
|
||||
layout->base.paged = 0;
|
||||
layout->base.unread_msg = 0;
|
||||
scrollok(layout->base.win, TRUE);
|
||||
new_win->window.layout = (ProfLayout*)layout;
|
||||
|
||||
@@ -709,7 +712,7 @@ win_page_down(ProfWin* window, int scroll_size)
|
||||
*page_start += scroll_size;
|
||||
|
||||
// Scrolled down after reaching the bottom of the page
|
||||
if ((*page_start > total_rows - page_space || (*page_start == page_space && *page_start >= total_rows)) && window->type == WIN_CHAT) {
|
||||
if (((*page_start > total_rows + window->layout->unread_msg - page_space) || ((*page_start == page_space + window->layout->unread_msg) && *page_start >= (total_rows + window->layout->unread_msg))) && window->type == WIN_CHAT) {
|
||||
int bf_size = buffer_size(window->layout->buffer);
|
||||
if (bf_size > 0 && *scroll_state != WIN_SCROLL_REACHED_BOTTOM) {
|
||||
// How many lines are left until end of the screen
|
||||
@@ -743,13 +746,15 @@ win_page_down(ProfWin* window, int scroll_size)
|
||||
window->layout->paged = 1;
|
||||
|
||||
// update only if position has changed
|
||||
if (page_start_initial != *page_start) {
|
||||
if ((page_start_initial != *page_start) || (window->layout->unread_msg)) {
|
||||
win_update_virtual(window);
|
||||
}
|
||||
|
||||
// switch off page if last line and space line visible
|
||||
if (total_rows - *page_start == page_space) {
|
||||
/*switch off page if no messages left to read
|
||||
TODO: update buffer end handling to check meassages just after last entry*/
|
||||
if (*scroll_state == WIN_SCROLL_REACHED_BOTTOM) {
|
||||
window->layout->paged = 0;
|
||||
window->layout->unread_msg = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,6 +815,7 @@ win_clear(ProfWin* window)
|
||||
int* page_start = &(window->layout->y_pos);
|
||||
*page_start = y;
|
||||
window->layout->paged = 1;
|
||||
window->layout->unread_msg = 0;
|
||||
win_update_virtual(window);
|
||||
}
|
||||
|
||||
@@ -914,6 +920,7 @@ void
|
||||
win_move_to_end(ProfWin* window)
|
||||
{
|
||||
window->layout->paged = 0;
|
||||
window->layout->unread_msg = 0;
|
||||
|
||||
int rows = getmaxy(stdscr);
|
||||
int y = getcury(window->layout->win);
|
||||
@@ -1696,6 +1703,13 @@ win_newline(ProfWin* window)
|
||||
static void
|
||||
_win_printf(ProfWin* window, const char* show_char, int pad_indent, GDateTime* timestamp, int flags, theme_item_t theme_item, const char* const display_from, const char* const from_jid, const char* const message_id, const char* const message, ...)
|
||||
{
|
||||
|
||||
/* Prevent printing and buffer update when user is viewing message history [SCROLLING]*/
|
||||
if ((window->layout->paged) && wins_is_current(window)) {
|
||||
window->layout->unread_msg++;
|
||||
return;
|
||||
}
|
||||
|
||||
if (timestamp == NULL) {
|
||||
timestamp = g_date_time_new_now_local();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user