mu-msg-file: calculate sha1 for messages
And use this to generate a message-id for messages that do not have one.
This commit is contained in:
@ -144,8 +144,8 @@ calculate_sha1 (FILE *file)
|
|||||||
static GMimeStream*
|
static GMimeStream*
|
||||||
get_mime_stream (MuMsgFile *self, const char *path, GError **err)
|
get_mime_stream (MuMsgFile *self, const char *path, GError **err)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
GMimeStream *stream;
|
GMimeStream *stream;
|
||||||
|
|
||||||
file = fopen (path, "r");
|
file = fopen (path, "r");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
@ -164,7 +164,6 @@ get_mime_stream (MuMsgFile *self, const char *path, GError **err)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return stream;
|
|
||||||
self->_sha1 = calculate_sha1(file);
|
self->_sha1 = calculate_sha1(file);
|
||||||
if (!self->_sha1) {
|
if (!self->_sha1) {
|
||||||
::fclose(file);
|
::fclose(file);
|
||||||
@ -173,6 +172,7 @@ get_mime_stream (MuMsgFile *self, const char *path, GError **err)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|||||||
Reference in New Issue
Block a user