]> granicus.if.org Git - neomutt/commitdiff
context: move message_is_tagged,message_is_visible
authorRichard Russon <rich@flatcap.org>
Thu, 10 Jan 2019 13:21:15 +0000 (13:21 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 12 Jan 2019 00:52:06 +0000 (00:52 +0000)
context.c
context.h
curs_lib.c
curs_lib.h

index ce2069e87127cb8e0c7826cee474469c07437adb..ce85900397f6132ff7f5d54c87963927e31d776d 100644 (file)
--- a/context.c
+++ b/context.c
@@ -278,3 +278,32 @@ void ctx_mailbox_changed(struct Mailbox *m, enum MailboxNotification action)
       break;
   }
 }
+
+/**
+ * message_is_visible - Is a message in the index within limit
+ * @param ctx   Open mailbox
+ * @param index Message ID (index into `ctx->emails[]`
+ * @retval true The message is within limit
+ *
+ * If no limit is in effect, all the messages are visible.
+ */
+bool message_is_visible(struct Context *ctx, int index)
+{
+  if (!ctx || !ctx->mailbox->emails || (index >= ctx->mailbox->msg_count))
+    return false;
+
+  return !ctx->pattern || ctx->mailbox->emails[index]->limited;
+}
+
+/**
+ * message_is_tagged - Is a message in the index tagged (and within limit)
+ * @param ctx   Open mailbox
+ * @param index Message ID (index into `ctx->emails[]`
+ * @retval true The message is both tagged and within limit
+ *
+ * If a limit is in effect, the message must be visible within it.
+ */
+bool message_is_tagged(struct Context *ctx, int index)
+{
+  return message_is_visible(ctx, index) && ctx->mailbox->emails[index]->tagged;
+}
index af73c2e6f2ef269924c29119759797a665cebbc5..e71ed1ad532ac060098ec0237735675b9d0b7ad4 100644 (file)
--- a/context.h
+++ b/context.h
@@ -54,4 +54,7 @@ void ctx_mailbox_changed(struct Mailbox *m, enum MailboxNotification action);
 void ctx_update(struct Context *ctx);
 void ctx_update_tables(struct Context *ctx, bool committing);
 
+bool message_is_tagged(struct Context *ctx, int index);
+bool message_is_visible(struct Context *ctx, int index);
+
 #endif /* MUTT_CONTEXT_H */
index ffdf69f51564e42977bd6d98149528e322d2ef49..482aaa02e3017fdecdb0ead601997a9e5777b531 100644 (file)
@@ -1208,32 +1208,3 @@ int mutt_strwidth(const char *s)
   }
   return w;
 }
-
-/**
- * message_is_visible - Is a message in the index within limit
- * @param ctx   Open mailbox
- * @param index Message ID (index into `ctx->emails[]`
- * @retval true The message is within limit
- *
- * If no limit is in effect, all the messages are visible.
- */
-bool message_is_visible(struct Context *ctx, int index)
-{
-  if (!ctx || !ctx->mailbox->emails || (index >= ctx->mailbox->msg_count))
-    return false;
-
-  return !ctx->pattern || ctx->mailbox->emails[index]->limited;
-}
-
-/**
- * message_is_tagged - Is a message in the index tagged (and within limit)
- * @param ctx   Open mailbox
- * @param index Message ID (index into `ctx->emails[]`
- * @retval true The message is both tagged and within limit
- *
- * If a limit is in effect, the message must be visible within it.
- */
-bool message_is_tagged(struct Context *ctx, int index)
-{
-  return message_is_visible(ctx, index) && ctx->mailbox->emails[index]->tagged;
-}
index 999a1395149a8f9bad09759f0093e6f0df88eef3..5c28b062aa295b3a7aa6e7ffc8889a9d79666940 100644 (file)
@@ -42,8 +42,6 @@ extern int MuttGetchTimeout; ///< Timeout in ms for mutt_getch()
 #define FMT_CENTER 0
 #define FMT_RIGHT  1
 
-bool         message_is_tagged(struct Context *ctx, int index);
-bool         message_is_visible(struct Context *ctx, int index);
 int          mutt_addwch(wchar_t wc);
 int          mutt_any_key_to_continue(const char *s);
 int          mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct Pager *info);