From a7ec793bf9814be7ea8d331ca3d1d35f58b17da1 Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 13 Sep 2019 00:36:54 +0200 Subject: Search in conv feature --- messageWind.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'messageWind.c') diff --git a/messageWind.c b/messageWind.c index 73d1182..5b71b5e 100644 --- a/messageWind.c +++ b/messageWind.c @@ -6,7 +6,6 @@ extern contact* contactList; extern size_t nbContacts; - conversation* currentConv; int x_WMessage = 1,y_WMessage = 1; @@ -127,6 +126,16 @@ void showMessageWind(void) { } +int searchSMS( const char* toSearch ) { + if( !currentConv ) + return -1; + for(int i = firstSMSIndex - 1; i >= 0 ; --i) { + if(strstr(currentConv->listSMS[i].text, toSearch) != NULL) + return i; + } + + return -1; +} -- cgit v1.2.3