94 |
|
if ((p = strchr(parv[1], ',')) != NULL) |
95 |
|
*p = '\0'; |
96 |
|
|
97 |
< |
if (parv[1][0] == '\0') |
97 |
> |
if (EmptyString(parv[1])) |
98 |
|
{ |
99 |
|
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), |
100 |
|
from, to, "TOPIC"); |
108 |
|
{ |
109 |
|
if ((chptr = hash_find_channel(parv[1])) == NULL) |
110 |
|
{ |
111 |
< |
/* if chptr isn't found locally, it =could= exist |
112 |
< |
* on the uplink. so forward reqeuest |
113 |
< |
*/ |
114 |
< |
if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL)) |
115 |
< |
{ |
116 |
< |
sendto_one(uplink, ":%s TOPIC %s %s", |
117 |
< |
ID_or_name(source_p, uplink), chptr->chname, |
118 |
< |
((parc > 2) ? parv[2] : "")); |
119 |
< |
return; |
120 |
< |
} |
121 |
< |
else |
122 |
< |
{ |
123 |
< |
sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), |
124 |
< |
from, to, parv[1]); |
125 |
< |
return; |
126 |
< |
} |
111 |
> |
sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), |
112 |
> |
from, to, parv[1]); |
113 |
> |
return; |
114 |
|
} |
115 |
|
|
116 |
|
/* setting topic */ |
122 |
|
to, parv[1]); |
123 |
|
return; |
124 |
|
} |
125 |
+ |
|
126 |
|
if ((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || |
127 |
|
has_member_flags(ms, CHFL_CHANOP|CHFL_HALFOP)) |
128 |
|
{ |
131 |
|
source_p->name, source_p->username, source_p->host); |
132 |
|
set_channel_topic(chptr, parv[2], topic_info, CurrentTime); |
133 |
|
|
134 |
< |
sendto_server(client_p, NULL, chptr, CAP_TS6, NOCAPS, NOFLAGS, |
134 |
> |
sendto_server(client_p, chptr, CAP_TS6, NOCAPS, |
135 |
|
":%s TOPIC %s :%s", |
136 |
|
ID(source_p), chptr->chname, |
137 |
|
chptr->topic == NULL ? "" : chptr->topic); |
138 |
< |
sendto_server(client_p, NULL, chptr, NOCAPS, CAP_TS6, NOFLAGS, |
138 |
> |
sendto_server(client_p, chptr, NOCAPS, CAP_TS6, |
139 |
|
":%s TOPIC %s :%s", |
140 |
|
source_p->name, chptr->chname, |
141 |
|
chptr->topic == NULL ? "" : chptr->topic); |
164 |
|
from, to, |
165 |
|
chptr->chname, chptr->topic); |
166 |
|
|
167 |
< |
/* client on LL needing the topic - if we have serverhide, say |
168 |
< |
* its the actual LL server that set the topic, not us the |
169 |
< |
* uplink -- fl_ |
170 |
< |
*/ |
183 |
< |
if (ConfigServerHide.hide_servers && !MyClient(source_p) |
184 |
< |
&& IsCapable(client_p, CAP_LL) && ServerInfo.hub) |
185 |
< |
{ |
186 |
< |
sendto_one(source_p, form_str(RPL_TOPICWHOTIME), |
187 |
< |
from, to, chptr->chname, |
188 |
< |
client_p->name, chptr->topic_time); |
189 |
< |
} |
190 |
< |
else |
191 |
< |
{ |
192 |
< |
sendto_one(source_p, form_str(RPL_TOPICWHOTIME), |
193 |
< |
from, to, chptr->chname, |
194 |
< |
chptr->topic_info, |
195 |
< |
chptr->topic_time); |
196 |
< |
} |
167 |
> |
sendto_one(source_p, form_str(RPL_TOPICWHOTIME), |
168 |
> |
from, to, chptr->chname, |
169 |
> |
chptr->topic_info, |
170 |
> |
chptr->topic_time); |
171 |
|
} |
172 |
|
} |
173 |
|
else |
219 |
|
|
220 |
|
if (ConfigServerHide.hide_servers) |
221 |
|
{ |
222 |
< |
sendto_channel_local(ALL_MEMBERS, NO, |
249 |
< |
chptr, ":%s TOPIC %s :%s", |
222 |
> |
sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s TOPIC %s :%s", |
223 |
|
me.name, chptr->chname, |
224 |
|
chptr->topic == NULL ? "" : chptr->topic); |
225 |
|
|
226 |
|
} |
227 |
|
else |
228 |
|
{ |
229 |
< |
sendto_channel_local(ALL_MEMBERS, NO, |
230 |
< |
chptr, ":%s TOPIC %s :%s", |
231 |
< |
source_p->name, |
259 |
< |
chptr->chname, chptr->topic == NULL ? "" : chptr->topic); |
229 |
> |
sendto_channel_local(ALL_MEMBERS, NO, chptr, ":%s TOPIC %s :%s", |
230 |
> |
source_p->name, chptr->chname, |
231 |
> |
chptr->topic == NULL ? "" : chptr->topic); |
232 |
|
} |
233 |
|
} |
234 |
|
} |