]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/pop3/serv_pop3.c
here be more migration
[citadel.git] / citadel / modules / pop3 / serv_pop3.c
index fcc194cca6b0119fbf4b5abb6a911a4ea9e9d57c..13230126320254368a75848633b13f2487d1a2a4 100644 (file)
@@ -1,21 +1,15 @@
 /*
  * POP3 service for the Citadel system
  *
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2015 by the citadel.org team
  *
- *  This program is open source software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3.
- *  
- *  
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  
- *  
- *  
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
  * Current status of standards conformance:
  *
@@ -95,10 +89,13 @@ void pop3_cleanup_function(void)
        /* Don't do this stuff if this is not a POP3 session! */
        if (CCC->h_command_function != pop3_command_loop) return;
 
+       struct citpop3 *pop3 = ((struct citpop3 *)CCC->session_specific_data);
        POP3M_syslog(LOG_DEBUG, "Performing POP3 cleanup hook");
-       if (POP3->msgs != NULL) free(POP3->msgs);
+       if (pop3->msgs != NULL) {
+               free(pop3->msgs);
+       }
 
-       free(POP3);
+       free(pop3);
 }
 
 
@@ -480,14 +477,14 @@ void pop3_update(void)
 
        /* Set last read pointer */
        if (POP3->num_msgs > 0) {
-               CtdlGetUserLock(&CCC->user, CCC->curr_user);
+               CtdlLockGetCurrentUser();
 
                CtdlGetRelationship(&vbuf, &CCC->user, &CCC->room);
                snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld",
                        POP3->msgs[POP3->num_msgs-1].msgnum);
                CtdlSetRelationship(&vbuf, &CCC->user, &CCC->room);
 
-               CtdlPutUserLock(&CCC->user);
+               CtdlPutCurrentUserLock();
        }
 
 }
@@ -718,14 +715,14 @@ CTDL_MODULE_INIT(pop3)
        {
                CtdlRegisterDebugFlagHook(HKEY("pop3srv"), SetPOP3DebugEnabled, &POP3DebugEnabled);
 
-               CtdlRegisterServiceHook(config.c_pop3_port,
+               CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3_port"),
                                        NULL,
                                        pop3_greeting,
                                        pop3_command_loop,
                                        NULL,
                                        CitadelServicePop3);
 #ifdef HAVE_OPENSSL
-               CtdlRegisterServiceHook(config.c_pop3s_port,
+               CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3s_port"),
                                        NULL,
                                        pop3s_greeting,
                                        pop3_command_loop,