unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 33f2817ae13d99f2c2f3fb65a1b07ed09be3d1a1 1954 bytes (raw)
name: notmuch-gmime-session.c 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
#include "notmuch-client.h"

/* CRUFTY BOILERPLATE for GMimeSession (dkg thinks this will go away once GMime 2.6 comes out) */
typedef struct _NotmuchGmimeSession NotmuchGmimeSession;
typedef struct _NotmuchGmimeSessionClass NotmuchGmimeSessionClass;

struct _NotmuchGmimeSession {
    GMimeSession parent_object;
};

struct _NotmuchGmimeSessionClass {
    GMimeSessionClass parent_class;
};

static void notmuch_gmime_session_class_init (NotmuchGmimeSessionClass *klass);

static GMimeSessionClass *parent_class = NULL;

GType
notmuch_gmime_session_get_type (void)
{
    static GType type = 0;

    if (!type) {
	static const GTypeInfo info = {
	    sizeof (NotmuchGmimeSessionClass),
	    NULL, /* base_class_init */
	    NULL, /* base_class_finalize */
	    (GClassInitFunc) notmuch_gmime_session_class_init,
	    NULL, /* class_finalize */
	    NULL, /* class_data */
	    sizeof (NotmuchGmimeSession),
	    0,    /* n_preallocs */
	    NULL, /* object_init */
	    NULL, /* value_table */
	};
	type = g_type_register_static (GMIME_TYPE_SESSION, "NotmuchGmimeSession", &info, 0);
    }
    return type;
}

/* 
   notmuch never prompts the user for a password.  It always returns
   an empty string (could it return a NULL pointer instead?)

   If credentials are needed for crypto, they should be supplied via
   other mechanisms (e.g. gpg-agent, etc)
 */
static char *never_request_passwd (unused (GMimeSession *session), unused (const char *prompt),
				   unused (gboolean secret), unused (const char *item),
				   unused (GError **err)) {
    fprintf (stderr, "Credentials needed for crypto; Please use gpg-agent.\n");
    return g_strdup ("");
}


static void
notmuch_gmime_session_class_init (NotmuchGmimeSessionClass *klass)
{
    GMimeSessionClass *session_class = GMIME_SESSION_CLASS (klass);
    parent_class = g_type_class_ref (GMIME_TYPE_SESSION);
    session_class->request_passwd = never_request_passwd;
}
/* END CRUFTY BOILERPLATE */

debug log:

solving 33f2817 ...
found 33f2817 in https://yhetil.org/notmuch/1307142188-6551-1-git-send-email-dkg@fifthhorseman.net/
found d83d9b3 in https://yhetil.org/notmuch.git/
preparing index
index prepared:
100644 d83d9b3daa1f7efdf0c765ec92a50343461b4bcf	notmuch-gmime-session.c

applying [1/1] https://yhetil.org/notmuch/1307142188-6551-1-git-send-email-dkg@fifthhorseman.net/
diff --git a/notmuch-gmime-session.c b/notmuch-gmime-session.c
index d83d9b3..33f2817 100644

1:9: trailing whitespace.
/* 
Checking patch notmuch-gmime-session.c...
Applied patch notmuch-gmime-session.c cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 33f2817ae13d99f2c2f3fb65a1b07ed09be3d1a1	notmuch-gmime-session.c

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).