changed cmd_myaccess: added ".. is owner of XX channel(s)."
authorZer0n <zer0n@webgamesnet.net>
Wed, 20 Jul 2011 18:42:12 +0000 (20:42 +0200)
committerZer0n <zer0n@webgamesnet.net>
Wed, 20 Jul 2011 18:42:12 +0000 (20:42 +0200)
src/chanserv.c

index 31f64d914e6a6c5cb01184398046976741f9e335..f90f0f6f6bde2c241aab487a4a2216428d3b15ed 100644 (file)
@@ -387,8 +387,9 @@ static const struct message_entry msgtab[] = {
     { "CSMSG_UC_H_TITLE", "network helper" },
     { "CSMSG_LC_H_TITLE", "support helper" },
     { "CSMSG_LAME_SMURF_TARGET", "%s is an IRC operator." },
-    { "CSMSG_MYACCESS_COUNT", "%s has access in $b%d$b channels." },
-    { "CSMSG_MYACCESS_COUNT_1", "%s has access in $b%d$b channel." },
+    { "CSMSG_MYACCESS_COUNT", "%s has access in $b%d$b channels and is owner of $b%d$b channel(s)." },
+       { "CSMSG_MYACCESS_COUNT_1", "%s has access in $b%d$b channel and is owner of $b%d$b channel(s)." },
+
 
 /* Seen information */
     { "CSMSG_NEVER_SEEN", "%s has never been seen in $b%s$b." },
@@ -3819,6 +3820,7 @@ static CHANSERV_FUNC(cmd_myaccess)
     struct handle_info *target_handle;
     struct userData *uData;
     int ccount = 0;
+       int ocount = 0;
 
     if(argc < 2)
         target_handle = user->handle_info;
@@ -3847,6 +3849,9 @@ static CHANSERV_FUNC(cmd_myaccess)
 
         if(uData->access > UL_OWNER)
             continue;
+        if(uData->access == UL_OWNER)
+            ocount++;
+
         if(IsProtected(cData)
            && (target_handle != user->handle_info)
            && !GetTrueChannelAccess(cData, user->handle_info))
@@ -3875,9 +3880,9 @@ static CHANSERV_FUNC(cmd_myaccess)
     }
 
     if(ccount == 1) {
-        reply("CSMSG_MYACCESS_COUNT_1", target_handle->handle, ccount);
+        reply("CSMSG_MYACCESS_COUNT_1", target_handle->handle, ccount, ocount);
     } else {
-        reply("CSMSG_MYACCESS_COUNT", target_handle->handle, ccount);
+        reply("CSMSG_MYACCESS_COUNT", target_handle->handle, ccount, ocount);
     }
 
     return 1;