]> Nishi Git Mirror - libw3.git/commitdiff
event handler
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Sat, 27 Jan 2024 01:33:03 +0000 (01:33 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Sat, 27 Jan 2024 01:33:03 +0000 (01:33 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@104 d27a3e52-49c5-7645-884c-6793ebffc270

Library/POP3.c

index ff5c9ae3ddfbf441b3857e6509a68fb586375892..0c15f5f7b49003b7114de4ad5f7b555f7697a564 100644 (file)
@@ -46,6 +46,11 @@ void __W3_POP3_Request(struct W3* w3) {
                                                if(login == 2){
                                                        /* Login success */
                                                        login = 3;
+                                                       void* funcptr = __W3_Get_Event(w3, "login");
+                                                       if(funcptr != NULL){
+                                                               void(*func)(struct W3*, const char*) = (void(*)(struct W3*, int))funcptr;
+                                                               func(w3, 512);
+                                                       }
                                                        __W3_Debug("LibW3-POP3", "Login successful");
                                                }else{
                                                }
@@ -53,7 +58,13 @@ void __W3_POP3_Request(struct W3* w3) {
                                                /* ERR */
                                                if(login == 2){
                                                        /* Login failed */
+                                                       void* funcptr = __W3_Get_Event(w3, "error");
+                                                       if(funcptr != NULL){
+                                                               void(*func)(struct W3*, const char*) = (void(*)(struct W3*, const char*))funcptr;
+                                                               func(w3, "login-fail");
+                                                       }
                                                        login = 0;
+                                                       return;
                                                }else{
                                                }
                                        }