diff options
author | ache <ache@ache.one> | 2019-09-13 00:36:54 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2019-09-13 00:36:54 +0200 |
commit | a7ec793bf9814be7ea8d331ca3d1d35f58b17da1 (patch) | |
tree | da27a7f018f299562a34e1cd7997a097991a0aa6 /messageWind.c | |
parent | Error when contact file is empty (diff) |
Search in conv feature
Diffstat (limited to 'messageWind.c')
-rw-r--r-- | messageWind.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; +} |