+static void
+osd_repeat(void)
+{
+ if(!osd_repeat_interval) return;
+ last_osd_repeat_time = time(NULL);
+ char new_msg[OSD_MSG_SIZE];
+ struct osd_params p = create_osd_params(if_use_box_osd_repeat);
+ format_osd(new_msg, &osd_repeat_opts, &p);
+ debug_osd_msg(new_msg);
+ osd_send(new_msg);
+ CLIST_FOR_EACH(struct mbox *, b, mboxes)
+ {
+ b->osd_repeat_last_total = b->total ;
+ b->osd_repeat_last_new = b->new ;
+ b->osd_repeat_last_flagged = b->flagged ;
+ strcpy(b->osd_repeat_last_sender_snippet , b->sender_snippet );
+ strcpy(b->osd_repeat_last_subject_snippet , b->subject_snippet);
+ }
+}
+
+static void
+rethink_osd_repeat(void)
+{
+ if(!osd_repeat_interval) return;
+ bool change = 0;
+ CLIST_FOR_EACH(struct mbox *, b, mboxes)
+ {
+ if( b->osd_repeat_last_total != b->total ) change = 1;
+ if( b->osd_repeat_last_new != b->new ) change = 1;
+ if( b->osd_repeat_last_flagged != b->flagged ) change = 1;
+ if(strcmp(b->osd_repeat_last_sender_snippet , b->sender_snippet )) change = 1;
+ if(strcmp(b->osd_repeat_last_subject_snippet , b->subject_snippet)) change = 1;
+ }
+ if(change) osd_repeat();
+}
+