aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-01-26 20:16:48 +0100
committerache <ache@ache.one>2018-01-26 20:16:48 +0100
commitf19d27b0ed458a7a08bb31927fcac9a5d328cbc1 (patch)
tree88ec4e8f2ca6f63ef5353e1ffefe81775258d51b
parentAdd an option to shown Number instead of name (diff)
Fix message showing bug
-rw-r--r--messageWind.c12
-rw-r--r--wind.c2
2 files changed, 9 insertions, 5 deletions
diff --git a/messageWind.c b/messageWind.c
index 28eaa54..98b2838 100644
--- a/messageWind.c
+++ b/messageWind.c
@@ -23,16 +23,20 @@ void toTheEnd(void) {
if( !currentConv )
return;
- int i = currentConv->nbSMS -1, size = h_WMessage ;
+ int i = currentConv->nbSMS -1, size = h_WMessage + 1;
char lin[200] = "";
+ char con[200] = "";
- for(; i > 0 && size > 0 ; i--) {
- size -= nbLineSMS(&currentConv->listSMS[i]) + 2;
+ for(; i > 0 && size >= 0 ; i--,size--) {
+ size -= nbLineSMS(&currentConv->listSMS[i]) + 1;
+ sprintf(con, "echo %d >> /tmp/a", nbLineSMS(&currentConv->listSMS[i]) + 1);
+ system(con);
+
}
if( size > 0 )
firstSMSIndex = 0;
else
- firstSMSIndex = i+1 == currentConv->nbSMS ? i : i+1;
+ firstSMSIndex = /*(i+1 == currentConv->nbSMS) ? i :*/ i+2;
// Seriously ... It can happen only if a SMS is greater than
// the windows size ... We simply show the begin of the SMS without
// the end. (Yeah, fuck this ...)
diff --git a/wind.c b/wind.c
index 796476d..6199e3e 100644
--- a/wind.c
+++ b/wind.c
@@ -24,7 +24,7 @@ void resize() {
y_WMessage = 1;
w_WMessage = (4*COLS)/5-2;
- h_WMessage = LINES-5;
+ h_WMessage = LINES-2;
clear();
showContactListW();