2009-12-05 [pawel] 3.7.3cvs33
[claws.git] / src / messageview.c
index e79c2210ff87a0cdc7e23f557c95aa9120027b1e..4dead34e1cd690347ad7bb7dce17918372c4f27c 100644 (file)
@@ -964,7 +964,11 @@ static gint disposition_notification_send(MsgInfo *msginfo)
        }
        
        if (account->gen_msgid) {
-               generate_msgid(buf, sizeof(buf));
+               gchar *addr = NULL;
+               if (account->msgid_with_addr) {
+                       addr = account->address;
+               }
+               generate_msgid(buf, sizeof(buf), addr);
 
                if (fprintf(fp, "Message-ID: <%s>\n", buf) < 0) {
                        fclose(fp);
@@ -1406,6 +1410,9 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
                }
        }
 done:
+       /* plugins may hook in here to work with the message view */
+       hooks_invoke(MESSAGE_VIEW_SHOW_DONE_HOOKLIST, messageview);
+
        g_free(file);
 
        return 0;
@@ -2795,7 +2802,12 @@ void messageview_list_urls (MessageView  *msgview)
 {
        GSList *cur = msgview->mimeview->textview->uri_list;
        GSList *newlist = NULL;
-       GHashTable *uri_hashtable = g_hash_table_new(g_str_hash, g_str_equal); 
+       GHashTable *uri_hashtable;
+       gchar *tmp;
+       
+       uri_hashtable = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                        (GDestroyNotify) g_free, NULL);
+       
        for (; cur; cur = cur->next) {
                ClickableText *uri = (ClickableText *)cur->data;
                if (uri->uri &&
@@ -2805,12 +2817,16 @@ void messageview_list_urls (MessageView *msgview)
                     !g_ascii_strncasecmp(uri->uri, "http:", 5) ||
                     !g_ascii_strncasecmp(uri->uri, "https:", 6)))
                {
-                       if(g_hash_table_lookup(uri_hashtable, uri->uri))
+                       tmp = g_utf8_strdown(uri->uri, -1);
+                       
+                       if (g_hash_table_lookup(uri_hashtable, tmp)) {
+                               g_free(tmp);
                                continue;
+                       }
                        
                        newlist = g_slist_prepend(newlist, uri);
-                       g_hash_table_insert(uri_hashtable, uri->uri,
-                                           GUINT_TO_POINTER(g_str_hash(uri->uri)));
+                       g_hash_table_insert(uri_hashtable, tmp,
+                                           GUINT_TO_POINTER(g_str_hash(tmp)));
                }
        }
        newlist = g_slist_reverse(newlist);