simplify hashes.
[apps/madmutt.git] / lib-mx / mx.c
index 9c0221a..d13a00f 100644 (file)
@@ -63,17 +63,14 @@ static int invoke_dotlock (const char *path, int flags, int retry)
   char cmd[LONG_STRING + _POSIX_PATH_MAX];
   char f[STRING + _POSIX_PATH_MAX];
   char r[STRING];
-  int pos;
 
   if (flags & DL_FL_RETRY)
     snprintf (r, sizeof (r), "-r %d ", retry ? MAXLOCKATTEMPT : 0);
 
   mutt_quote_filename (f, sizeof (f), path);
 
-  pos  = mlua_value(cmd, sizeof(cmd), "madmutt", "dotlock");
-
-  snprintf(cmd + pos, sizeof(cmd) - pos,
-            " %s%s%s%s%s%s%s",
+  snprintf(cmd, sizeof(cmd), "%s %s%s%s%s%s%s%s",
+            mlua_reggets(LTK_DOTLOCK),
             flags & DL_FL_TRY ? "-t " : "",
             flags & DL_FL_UNLOCK ? "-u " : "",
             flags & DL_FL_USEPRIV ? "-p " : "",
@@ -1272,10 +1269,10 @@ void mx_update_context (CONTEXT * ctx, int new_messages)
 
     /* add this message to the hash tables */
     if (ctx->id_hash && h->env->message_id)
-      hash_insert (ctx->id_hash, h->env->message_id, h, 0);
+      hash_insert (ctx->id_hash, h->env->message_id, h);
     if (!ctx->counting) {
       if (ctx->subj_hash && h->env->real_subj)
-        hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
+        hash_insert (ctx->subj_hash, h->env->real_subj, h);
 
       if (option (OPTSCORE))
         mutt_score_message (ctx, h, 0);