1
0

0008-ngircd-Allow-setting-modes-by-clients-on-burst.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From d363ebd841ea7e1db3c62730023759d69520e0d8 Mon Sep 17 00:00:00 2001
  2. From: Alexander Barton <alex@barton.de>
  3. Date: Tue, 27 Sep 2011 15:08:09 +0200
  4. Subject: [PATCH 08/16] ngircd: Allow setting modes by clients on burst
  5. This change is required by commit 43201ead9575a for the ngIRCd protocol
  6. module as well.
  7. ---
  8. modules/protocol/ngircd.cpp | 7 +++++--
  9. 1 files changed, 5 insertions(+), 2 deletions(-)
  10. diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
  11. index 3024fdd..2774168 100644
  12. --- a/modules/protocol/ngircd.cpp
  13. +++ b/modules/protocol/ngircd.cpp
  14. @@ -57,14 +57,17 @@ class ngIRCdProto : public IRCDProto
  15. send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
  16. }
  17. - void SendJoin(User *user, Channel *c, const ChannelStatus *status)
  18. + void SendJoin(User *user, Channel *c, ChannelStatus *status)
  19. {
  20. send_cmd(user->nick, "JOIN %s", c->name.c_str());
  21. if (status)
  22. {
  23. + ChannelStatus cs = *status;
  24. + status->ClearFlags();
  25. +
  26. BotInfo *setter = findbot(user->nick);
  27. for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
  28. - if (status->HasFlag(ModeManager::ChannelModes[i]->Name))
  29. + if (cs.HasFlag(ModeManager::ChannelModes[i]->Name))
  30. c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false);
  31. }
  32. }
  33. --
  34. 1.7.8.3