|
48 | 48 | * |
49 | 49 | * # Default flags granted when a user JOINs an open group. |
50 | 50 | * # These are GroupServ access flags (NOT IRC user modes). |
51 | | - * # Accepts: +A +i, +ACLVIEW +INVITE, or compact +Ai. |
| 51 | + * # Accepts: +A +I, +ACLVIEW +INVITE, or compact +AI. |
52 | 52 | * default_joinflags = "+A" |
53 | 53 | * |
54 | 54 | * # Auto-save interval in seconds (0 disables periodic autosave) |
@@ -1037,7 +1037,7 @@ class GroupServ final |
1037 | 1037 | GroupServ(const Anope::string& modname, const Anope::string& creator) |
1038 | 1038 | : Module(modname, creator, VENDOR) |
1039 | 1039 | , core(this) |
1040 | | - , chanaccess(this, "groupserv/chanaccess") |
| 1040 | + , chanaccess(this, "groupserv:chanaccess") |
1041 | 1041 | , chanaccess_type(chanaccess) |
1042 | 1042 | , cmd_cs_set_group(this, core, chanaccess) |
1043 | 1043 | , cmd_cs_set_grouponly(this, core, chanaccess) |
@@ -1124,6 +1124,31 @@ class GroupServ final |
1124 | 1124 | } |
1125 | 1125 | info["GroupServ"] = out; |
1126 | 1126 | } |
| 1127 | + |
| 1128 | + void OnChanInfo(CommandSource& source, ChannelInfo* ci, InfoFormatter& info, bool show_hidden) override |
| 1129 | + { |
| 1130 | + if (!ci) |
| 1131 | + return; |
| 1132 | + |
| 1133 | + auto* d = this->chanaccess.Get(ci); |
| 1134 | + if (!d || d->group.empty()) |
| 1135 | + return; |
| 1136 | + |
| 1137 | + GSGroupFlags gflags = GSGroupFlags::NONE; |
| 1138 | + if (!this->core.GetGroupFlags(d->group, gflags)) |
| 1139 | + { |
| 1140 | + // Only show missing associations to users who can already see hidden details. |
| 1141 | + if (show_hidden) |
| 1142 | + info[_("GroupServ")] = d->group + " (missing)"; |
| 1143 | + return; |
| 1144 | + } |
| 1145 | + |
| 1146 | + // Mirror NickServ INFO behaviour: only show non-public groups to users who can see hidden details. |
| 1147 | + if (!show_hidden && !HasFlag(gflags, GSGroupFlags::PUBLIC)) |
| 1148 | + return; |
| 1149 | + |
| 1150 | + info[_("GroupServ")] = d->group; |
| 1151 | + } |
1127 | 1152 | }; |
1128 | 1153 |
|
1129 | 1154 | MODULE_INIT(GroupServ) |
0 commit comments