]> jfr.im git - irc/quakenet/newserv.git/blobdiff - helpmod2/hconf.c
CHANSERV: fix issue where chanserv_relay doesn't wait for db to be loaded before...
[irc/quakenet/newserv.git] / helpmod2 / hconf.c
index 028e0c4a7e7ca1007a9c4f82daf50d12c6902a9a..2de5ba2ac36b8e13121d9ef9a00a5783df751d72 100644 (file)
@@ -444,6 +444,12 @@ int helpmod_config_read_account(FILE *in)
        if (sscanf(ptr, "%x %x %x", (unsigned int*)&level, (unsigned int*)&flags, (unsigned int *)&last_activity) != 3)
            return -1;
 
+    if (hconf_version < HELPMOD_VERSION_2_16)
+    { /* For the new friend userlevel */
+       if (level >= H_FRIEND)
+           level++;
+    }
+
     hack->level = level;
     hack->flags = flags;
     hack->last_activity = last_activity;
@@ -824,7 +830,22 @@ int helpmod_config_read_ticket(FILE *in)
         return -1;
 
     if (tmp > time(NULL))
-        hticket_add(buf3, tmp, hchannel_get_by_name(buf2));
+    {
+       if (hconf_version < HELPMOD_VERSION_2_17)
+           hticket_add(buf3, tmp, hchannel_get_by_name(buf2), NULL);
+       else
+       {
+           fgets(ptr = buf, 256, in);
+           if (feof(in))
+               return -1;
+           helpmod_line_fix(&ptr);
+
+           if (*ptr == '\0')
+               hticket_add(buf3, tmp, hchannel_get_by_name(buf2), NULL);
+           else
+                hticket_add(buf3, tmp, hchannel_get_by_name(buf2), ptr);
+       }
+    }
 
     return 0;
 }
@@ -834,6 +855,10 @@ int helpmod_config_write_ticket(FILE *out, hticket *htick, hchannel *hchan)
     fprintf(out, "\t%s\n", hchannel_get_name(hchan));
     fprintf(out, "\t%s\n", htick->authname);
     fprintf(out, "\t%u\n", (unsigned int)htick->time_expiration);
+    if (htick->message)
+       fprintf(out, "\t%s\n", htick->message->content);
+    else
+        fprintf(out, "\n");
 
     return 0;
 }