Enlightenment CVS committal

Author  : tsauerbeck
Project : misc
Module  : embrace

Dir     : misc/embrace/src/plugins/imap


Modified Files:
        imap.c 


Log Message:
fixed ecore event handling
===================================================================
RCS file: /cvsroot/enlightenment/misc/embrace/src/plugins/imap/imap.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- imap.c      17 Apr 2004 15:47:17 -0000      1.9
+++ imap.c      17 Apr 2004 17:40:13 -0000      1.10
@@ -1,5 +1,5 @@
 /*
- * $Id: imap.c,v 1.9 2004/04/17 15:47:17 tsauerbeck Exp $
+ * $Id: imap.c,v 1.10 2004/04/17 17:40:13 tsauerbeck Exp $
  * vim:noexpandtab:ts=4:sw=4:sts=4
  *
  * Copyright (C) 2004 Embrace project.
@@ -29,9 +29,10 @@
 
 #include <embrace_plugin.h>
 
-#define IDENT "EMBRACE_IMAP_PLUGIN"
 #define MAX_INTERVAL 300
 
+static EmbracePlugin *plugin = NULL;
+
 static int on_server_add (void *udata, int type, void *event)
 {
        Ecore_Con_Event_Server_Add *ev = event;
@@ -39,10 +40,11 @@
        char buf[256];
        int len;
 
-       if (strcmp ((char *) udata, IDENT))
-               return 1;
-
        mb = ecore_con_server_data_get (ev->server);
+       assert (mb);
+
+       if (mailbox_plugin_get (mb) != plugin)
+               return 1;
 
        /* now login to the server */
        len = snprintf (buf, sizeof (buf), "A001 LOGIN %s %s\r\n",
@@ -61,10 +63,11 @@
        char realbuf[1024], *buf = realbuf;
        int num = 0, new = 0, len;
 
-       if (strcmp ((char *) udata, IDENT))
-               return 1;
-
        mb = ecore_con_server_data_get (ev->server);
+       assert (mb);
+
+       if (mailbox_plugin_get (mb) != plugin)
+               return 1;
 
        /* take the data and make a NUL-terminated string out of it */
        len = sizeof (realbuf) - 1;
@@ -239,6 +242,7 @@
 
 bool embrace_plugin_init (EmbracePlugin *ep)
 {
+       plugin = ep;
        snprintf (ep->name, sizeof (ep->name), "%s", "imap");
 
        ep->check = imap_check;
@@ -251,9 +255,9 @@
        ecore_con_init ();
 
        ecore_event_handler_add (ECORE_CON_EVENT_SERVER_ADD,
-                                on_server_add, IDENT);
+                                on_server_add, NULL);
        ecore_event_handler_add (ECORE_CON_EVENT_SERVER_DATA,
-                                on_server_data, IDENT);
+                                on_server_data, NULL);
 
        return true;
 }




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to