Lines 447-455
Link Here
|
447 |
return r; |
447 |
return r; |
448 |
} |
448 |
} |
449 |
|
449 |
|
|
|
450 |
/* called to prepare the next chat contact, returns true if it found one, false otherwise |
451 |
parameter is true if its next chat contact or false if is the previous |
452 |
*/ |
453 |
bool icqface::next_chat(bool next) { |
454 |
find_next_action = (next ? 1:-1); |
455 |
if (last_selected) last_selected->setopenedforchat(false); |
456 |
return true; |
457 |
} |
458 |
|
459 |
icqcontact *icqface::find_next_chat() { |
460 |
if (find_next_action == 0) return 0; |
461 |
int i; |
462 |
if (last_selected){ |
463 |
for(i = 0; i < clist.count && clist.at(i) != last_selected; i++) |
464 |
; |
465 |
i += find_next_action; |
466 |
if (i <= 0) i = clist.count -1; |
467 |
else if (i >= clist.count) i = 0; |
468 |
} |
469 |
else i = find_next_action == 1 ? 0 : clist.count -1; |
470 |
|
471 |
icqcontact *c; |
472 |
for (; i < clist.count && i >= 0; i += find_next_action){ |
473 |
c = (icqcontact *) clist.at(i); |
474 |
if (c->isopenedforchat() || c->hasevents()) { |
475 |
find_next_action = 0; |
476 |
return c; |
477 |
} |
478 |
} |
479 |
|
480 |
find_next_action = 0; |
481 |
return 0; |
482 |
} |
483 |
|
450 |
icqcontact *icqface::mainloop(int &action) { |
484 |
icqcontact *icqface::mainloop(int &action) { |
451 |
int i, curid; |
485 |
int i, curid; |
452 |
icqcontact *c = 0; icqgroup *g; |
486 |
icqcontact *c = 0, *c1 = 0; icqgroup *g; |
453 |
bool fin; |
487 |
bool fin; |
454 |
|
488 |
|
455 |
for(fin = false; !fin; ) { |
489 |
for(fin = false; !fin; ) { |
Lines 457-464
Link Here
|
457 |
|
491 |
|
458 |
/* Obtain the (icqcontact *) from the treeview. If a node is |
492 |
/* Obtain the (icqcontact *) from the treeview. If a node is |
459 |
selected, throw out the contact and obtain the correct (icqgroup *). */ |
493 |
selected, throw out the contact and obtain the correct (icqgroup *). */ |
460 |
|
494 |
c = find_next_chat(); //check if next_chat was called from inside a chat window |
461 |
c = (icqcontact *) mcontacts->open(&i); |
495 |
if (!c){ |
|
|
496 |
last_selected = 0; |
497 |
c = (icqcontact *) mcontacts->open(&i); |
498 |
if (c1 = find_next_chat()) c = c1; //check if next_chat was called from contacts menu |
499 |
} |
462 |
|
500 |
|
463 |
if(mcontacts->isnode(i) && c) { |
501 |
if(mcontacts->isnode(i) && c) { |
464 |
c = 0; |
502 |
c = 0; |
Lines 529-535
Link Here
|
529 |
break; |
567 |
break; |
530 |
} |
568 |
} |
531 |
} |
569 |
} |
532 |
|
570 |
if (c) last_selected = c; |
533 |
return c; |
571 |
return c; |
534 |
} |
572 |
} |
535 |
|
573 |
|
Lines 2192-2203
Link Here
|
2192 |
void icqface::showeventbottom(const imcontact &ic) { |
2230 |
void icqface::showeventbottom(const imcontact &ic) { |
2193 |
const char *text = ischannel(ic) ? |
2231 |
const char *text = ischannel(ic) ? |
2194 |
_("%s send, %s multi, %s history, %s URLs, %s expand, %s members, %s close") : |
2232 |
_("%s send, %s multi, %s history, %s URLs, %s expand, %s members, %s close") : |
2195 |
_("%s send, %s multi, %s history, %s URLs, %s expand, %s details, %s cancel"); |
2233 |
_("%s send, %s multi, %s history, %s next chat, %s URLs, %s expand, %s details, %s cancel"); |
2196 |
|
2234 |
|
2197 |
status(text, |
2235 |
status(text, |
2198 |
getstatkey(key_send_message, section_editor).c_str(), |
2236 |
getstatkey(key_send_message, section_editor).c_str(), |
2199 |
getstatkey(key_multiple_recipients, section_editor).c_str(), |
2237 |
getstatkey(key_multiple_recipients, section_editor).c_str(), |
2200 |
getstatkey(key_history, section_editor).c_str(), |
2238 |
getstatkey(key_history, section_editor).c_str(), |
|
|
2239 |
getstatkey(key_next_chat, section_editor).c_str(), |
2201 |
getstatkey(key_show_urls, section_editor).c_str(), |
2240 |
getstatkey(key_show_urls, section_editor).c_str(), |
2202 |
getstatkey(key_fullscreen, section_editor).c_str(), |
2241 |
getstatkey(key_fullscreen, section_editor).c_str(), |
2203 |
getstatkey(key_info, section_editor).c_str(), |
2242 |
getstatkey(key_info, section_editor).c_str(), |
Lines 2620-2625
Link Here
|
2620 |
chatlastread = 0; |
2659 |
chatlastread = 0; |
2621 |
inchat = true; |
2660 |
inchat = true; |
2622 |
passinfo = ic; |
2661 |
passinfo = ic; |
|
|
2662 |
c->setopenedforchat(true); |
2623 |
|
2663 |
|
2624 |
muins.clear(); |
2664 |
muins.clear(); |
2625 |
muins.push_back(passinfo); |
2665 |
muins.push_back(passinfo); |
Lines 2666-2671
Link Here
|
2666 |
c->setpostponed(editdone ? "" : p.get()); |
2706 |
c->setpostponed(editdone ? "" : p.get()); |
2667 |
} |
2707 |
} |
2668 |
|
2708 |
|
|
|
2709 |
c->toggleopenedforchat(); |
2669 |
c->save(); |
2710 |
c->save(); |
2670 |
restoreworkarea(); |
2711 |
restoreworkarea(); |
2671 |
status("@"); |
2712 |
status("@"); |
Lines 3196-3201
Link Here
|
3196 |
face.extk = ACT_HISTORY; |
3237 |
face.extk = ACT_HISTORY; |
3197 |
break; |
3238 |
break; |
3198 |
|
3239 |
|
|
|
3240 |
case key_next_chat: |
3241 |
face.extk = ACT_MSG; |
3242 |
face.next_chat(true); |
3243 |
break; |
3244 |
|
3245 |
case key_prev_chat: |
3246 |
face.extk = ACT_MSG; |
3247 |
face.next_chat(false); |
3248 |
break; |
3249 |
|
3199 |
case key_add: face.extk = ACT_ADD; break; |
3250 |
case key_add: face.extk = ACT_ADD; break; |
3200 |
|
3251 |
|
3201 |
case key_send_contact: |
3252 |
case key_send_contact: |
Lines 3323-3328
Link Here
|
3323 |
case key_history: |
3374 |
case key_history: |
3324 |
cicq.history(face.passinfo); |
3375 |
cicq.history(face.passinfo); |
3325 |
break; |
3376 |
break; |
|
|
3377 |
case key_prev_chat: |
3378 |
face.editdone = false; |
3379 |
face.next_chat(false); |
3380 |
return -1; |
3381 |
case key_next_chat: |
3382 |
face.editdone = false; |
3383 |
face.next_chat(true); |
3384 |
return -1; |
3326 |
case key_info: |
3385 |
case key_info: |
3327 |
cicq.userinfo(face.passinfo); |
3386 |
cicq.userinfo(face.passinfo); |
3328 |
break; |
3387 |
break; |