+
+ snprintf (entry, len-lencnt, "%s", box);
+ entry[mutt_strlen (entry)] = ' ';
+ strncpy (entry + (len - lencnt), no, lencnt);
+
+ addnstr (entry, len);
+
+ if (shortened)
+ FREE(&box);
+
+ return (1);
+}
+
+/* returns folder name of currently
+ * selected folder for <sidebar-open>
+ */
+const char* sidebar_get_current (void) {
+ if (list_empty(Incoming))
+ return (NULL);
+ return ((char*) ((BUFFY*) Incoming->data[CurBuffy])->path);
+}
+
+/* internally sets item to buf */
+void sidebar_set_current (const char* buf) {
+ int i = buffy_lookup (buf);
+ if (i >= 0)
+ CurBuffy = i;
+}
+
+/* fix counters for a context
+ * FIXME since ctx must not be of our business, move it elsewhere
+ */
+void sidebar_set_buffystats (CONTEXT* Context) {
+ int i = 0;
+ BUFFY* tmp = NULL;
+ if (!Context || list_empty(Incoming) || (i = buffy_lookup (Context->path)) < 0)
+ return;
+ tmp = (BUFFY*) Incoming->data[i];
+ tmp->new = Context->new;
+ tmp->msg_unread = Context->unread;
+ tmp->msgcount = Context->msgcount;
+ tmp->msg_flagged = Context->flagged;