Changeset 0697f097cd4d945d2e96f60d1690da9c5f4d9dc4

Show
Ignore:
Timestamp:
10/19/09 22:21:04 (5 weeks ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
git-author:
Alejandro R. Sedeño <asedeno@mit.edu> / 2009-10-13T03:18:13Z-0400
Parents:
12e291a330f117a61b8b222315c1f39822010a2a
Children:
26255f0a891e35ce73aef0db49ff403c3d69efeb
git-committer:
Alejandro R. Sedeño <asedeno@mit.edu> / 2009-10-19T22:21:04Z-0400
Message:
Drop owl_animate_hack.
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • owl.c

    rdbf94e9 r0697f09  
    470470  owl_popwin *pw; 
    471471  int argcsave, followlast; 
    472   int newmsgs, nexttimediff; 
     472  int newmsgs; 
    473473  const char *const *argvsave; 
    474474  char *perlout, *perlerr; 
    475475  const owl_style *s; 
    476   time_t nexttime, now; 
    477   struct tm *today; 
    478476  const char *dir; 
    479477  owl_message *m; 
     
    621619  owl_context_set_interactive(owl_global_get_context(&g)); 
    622620 
    623   nexttimediff=10; 
    624   nexttime=time(NULL); 
    625  
    626621  owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL, NULL); 
    627622 
     
    643638 
    644639    followlast=owl_global_should_followlast(&g); 
    645  
    646     /* little hack */ 
    647     now=time(NULL); 
    648     today=localtime(&now); 
    649     if (today->tm_mon==9 && today->tm_mday==31 && owl_global_get_runtime(&g)<600) { 
    650       if (time(NULL)>nexttime) { 
    651         if (nexttimediff==1) { 
    652           nexttimediff=10; 
    653         } else { 
    654           nexttimediff=1; 
    655         } 
    656         nexttime+=nexttimediff; 
    657         owl_hack_animate(); 
    658       } 
    659     } 
    660640 
    661641    /* Grab incoming messages. */ 
  • util.c

    r435001d r0697f09  
    475475} 
    476476 
    477  
    478 /* Animation hack */ 
    479 void owl_hack_animate(void) 
    480 { 
    481   const owl_messagelist *ml; 
    482   owl_message *m; 
    483   owl_fmtext *fm; 
    484   const char *text, *ptr; 
    485   int place; 
    486  
    487   /* grab the first message and make sure its id is 0 */ 
    488   ml=owl_global_get_msglist(&g); 
    489   m=owl_messagelist_get_element(ml, 0); 
    490   if (!m) return; 
    491   if (owl_message_get_id(m)!=0) return; 
    492  
    493   fm=owl_message_get_fmtext(m); 
    494   text=owl_fmtext_get_text(fm); 
    495  
    496   ptr=strstr(text, "OvO"); 
    497   if (ptr) { 
    498     place=ptr-text; 
    499     owl_fmtext_set_char(fm, place, '-'); 
    500     owl_fmtext_set_char(fm, place+2, '-'); 
    501  
    502     owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 
    503     if (owl_popwin_is_active(owl_global_get_popwin(&g))) { 
    504       owl_popwin_refresh(owl_global_get_popwin(&g)); 
    505       /* TODO: this is a broken kludge */ 
    506       if (owl_global_get_viewwin(&g)) { 
    507         owl_viewwin_redisplay(owl_global_get_viewwin(&g), 0); 
    508       } 
    509     } 
    510     owl_global_set_needrefresh(&g); 
    511     return; 
    512   } 
    513  
    514   ptr=strstr(text, "-v-"); 
    515   if (ptr) { 
    516     place=ptr-text; 
    517     owl_fmtext_set_char(fm, place, 'O'); 
    518     owl_fmtext_set_char(fm, place+2, 'O'); 
    519  
    520     owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 
    521     if (owl_popwin_is_active(owl_global_get_popwin(&g))) { 
    522       owl_popwin_refresh(owl_global_get_popwin(&g)); 
    523       /* TODO: this is a broken kludge */ 
    524       if (owl_global_get_viewwin(&g)) { 
    525         owl_viewwin_redisplay(owl_global_get_viewwin(&g), 0); 
    526       } 
    527     } 
    528     owl_global_set_needrefresh(&g); 
    529     return; 
    530   } 
    531 } 
    532  
    533477/* strip leading and trailing new lines.  Caller must free the 
    534478 * return.