aboutsummaryrefslogtreecommitdiff
path: root/messageWind.c
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 /messageWind.c
parentAdd an option to shown Number instead of name (diff)
Fix message showing bug
Diffstat (limited to 'messageWind.c')
-rw-r--r--messageWind.c12
1 files changed, 8 insertions, 4 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 ...)