Browse Source

Merge pull request #1564 from slingamn/issue1563_modeparam

fix #1563
tags/v2.6.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
1d3d9f4cf5
No account linked to committer's email address
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      irc/modes.go

+ 5
- 5
irc/modes.go View File

225
 					appliedChange.Arg = maskAdded
225
 					appliedChange.Arg = maskAdded
226
 					applied = append(applied, appliedChange)
226
 					applied = append(applied, appliedChange)
227
 				} else if err != nil {
227
 				} else if err != nil {
228
-					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, mask, fmt.Sprintf(client.t("Invalid mode %[1]s parameter: %[2]s"), string(change.Mode), mask))
228
+					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, string(change.Mode), utils.SafeErrorParam(mask), fmt.Sprintf(client.t("Invalid mode %[1]s parameter: %[2]s"), string(change.Mode), mask))
229
 				} else {
229
 				} else {
230
 					rb.Add(nil, client.server.name, ERR_LISTMODEALREADYSET, chname, mask, string(change.Mode), fmt.Sprintf(client.t("Channel %[1]s list already contains %[2]s"), chname, mask))
230
 					rb.Add(nil, client.server.name, ERR_LISTMODEALREADYSET, chname, mask, string(change.Mode), fmt.Sprintf(client.t("Channel %[1]s list already contains %[2]s"), chname, mask))
231
 				}
231
 				}
237
 					appliedChange.Arg = maskRemoved
237
 					appliedChange.Arg = maskRemoved
238
 					applied = append(applied, appliedChange)
238
 					applied = append(applied, appliedChange)
239
 				} else if err != nil {
239
 				} else if err != nil {
240
-					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, mask, fmt.Sprintf(client.t("Invalid mode %[1]s parameter: %[2]s"), string(change.Mode), mask))
240
+					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, string(change.Mode), utils.SafeErrorParam(mask), fmt.Sprintf(client.t("Invalid mode %[1]s parameter: %[2]s"), string(change.Mode), mask))
241
 				} else {
241
 				} else {
242
 					rb.Add(nil, client.server.name, ERR_LISTMODENOTSET, chname, mask, string(change.Mode), fmt.Sprintf(client.t("Channel %[1]s list does not contain %[2]s"), chname, mask))
242
 					rb.Add(nil, client.server.name, ERR_LISTMODENOTSET, chname, mask, string(change.Mode), fmt.Sprintf(client.t("Channel %[1]s list does not contain %[2]s"), chname, mask))
243
 				}
243
 				}
262
 			case modes.Add:
262
 			case modes.Add:
263
 				ch := client.server.channels.Get(change.Arg)
263
 				ch := client.server.channels.Get(change.Arg)
264
 				if ch == nil {
264
 				if ch == nil {
265
-					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, utils.SafeErrorParam(change.Arg), fmt.Sprintf(client.t("No such channel")))
265
+					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, string(change.Mode), utils.SafeErrorParam(change.Arg), fmt.Sprintf(client.t("No such channel")))
266
 				} else if ch == channel {
266
 				} else if ch == channel {
267
-					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, utils.SafeErrorParam(change.Arg), fmt.Sprintf(client.t("You can't forward a channel to itself")))
267
+					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, string(change.Mode), utils.SafeErrorParam(change.Arg), fmt.Sprintf(client.t("You can't forward a channel to itself")))
268
 				} else {
268
 				} else {
269
 					if !ch.ClientIsAtLeast(client, modes.ChannelOperator) {
269
 					if !ch.ClientIsAtLeast(client, modes.ChannelOperator) {
270
 						rb.Add(nil, client.server.name, ERR_CHANOPRIVSNEEDED, details.nick, ch.Name(), client.t("You must be a channel operator in the channel you are forwarding to"))
270
 						rb.Add(nil, client.server.name, ERR_CHANOPRIVSNEEDED, details.nick, ch.Name(), client.t("You must be a channel operator in the channel you are forwarding to"))
286
 					channel.setKey(change.Arg)
286
 					channel.setKey(change.Arg)
287
 					applied = append(applied, change)
287
 					applied = append(applied, change)
288
 				} else {
288
 				} else {
289
-					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, "*", fmt.Sprintf(client.t("Invalid mode %[1]s parameter: %[2]s"), string(change.Mode), change.Arg))
289
+					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, string(change.Mode), utils.SafeErrorParam(change.Arg), fmt.Sprintf(client.t("Invalid mode %[1]s parameter: %[2]s"), string(change.Mode), change.Arg))
290
 				}
290
 				}
291
 			case modes.Remove:
291
 			case modes.Remove:
292
 				channel.setKey("")
292
 				channel.setKey("")

Loading…
Cancel
Save