Mercurial > prosody-modules
comparison mod_ircd/mod_ircd.in.lua @ 484:0b75c7d41b82
mod_ircd: added role check for who sets the topic, to make sure that who sets the topic is actually a moderator.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Mon, 28 Nov 2011 16:07:17 +0000 |
parents | f4ada087c743 |
children | f8cc2be7e16a |
comparison
equal
deleted
inserted
replaced
483:f4ada087c743 | 484:0b75c7d41b82 |
---|---|
456 channel = utf8_clean(channel); | 456 channel = utf8_clean(channel); |
457 topic = utf8_clean(topic); | 457 topic = utf8_clean(topic); |
458 if not channel then return end | 458 if not channel then return end |
459 local room = session.rooms[channel]; | 459 local room = session.rooms[channel]; |
460 | 460 |
461 if topic then | 461 if topic and room.occupants[room.nick]["role"] == "moderator" then room:set_subject(topic); end |
462 room:set_subject(topic) | |
463 session.send((":%s TOPIC %s :%s"):format(room.nick, room.channel, room.subject or "")); | |
464 end | |
465 end | 462 end |
466 | 463 |
467 function commands.WHO(session, args) | 464 function commands.WHO(session, args) |
468 local channel = args[1]; | 465 local channel = args[1]; |
469 if session.rooms[channel] then | 466 if session.rooms[channel] then |