aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-01-24 08:25:07 +0100
committerache <ache@ache.one>2019-01-24 08:25:07 +0100
commit8ad44911e0b2ce4a01bbca94bd456dfc820e9467 (patch)
treeb49c704d9f63023eda621077a1d524afc983493d
parentFix readline (diff)
Search function
-rw-r--r--main.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/main.c b/main.c
index b4fec25..086ed8e 100644
--- a/main.c
+++ b/main.c
@@ -157,7 +157,7 @@ int main(int argc, char* argv[]){
visual_mode = true;
curs_set(0);
- cmd_win = newwin(1, COLS, LINES - 20, 0);
+ cmd_win = newwin(1, COLS, LINES - 1, 0);
sep_win = newwin(1, COLS, LINES - 2, 0);
init_pair( 12, COLOR_WHITE, COLOR_BLUE);
@@ -236,6 +236,22 @@ int main(int argc, char* argv[]){
if( currentConv )
tabed = !tabed;
break;
+ case '/': // Search by name
+ if( !tabed ) {
+ contact* found = NULL;
+ move(LINES-1,0);
+ readline_n();
+ int r = findContactFromName(msg_win_str, &found);
+
+ if( r == 0 ) {
+ setContactSelection(found);
+ } else {
+ printf("[%d]%s\n", r, msg_win_str);
+ }
+ curs_set(0);
+ showContactListW();
+ }
+ break;
case 'n':
showName = !showName;
showContactListW();
@@ -247,6 +263,7 @@ int main(int argc, char* argv[]){
resize();
}
break;
+ case 'i':
case 's': {
char* number = NULL;