]> jfr.im git - irc/freenode/syn.git/commitdiff
and update atheme patch for 7
authorStephen Bennett <redacted>
Thu, 6 Jun 2013 15:50:28 +0000 (15:50 +0000)
committerStephen Bennett <redacted>
Thu, 6 Jun 2013 15:50:28 +0000 (15:50 +0000)
atheme-host-change-hook.diff

index a8d4de0d5f7a9fe7a5c21e97109bc8501611015e..fe69ec54373273aac3a965848c9bfd9a057d9c61 100644 (file)
@@ -1,8 +1,9 @@
-diff -r 64a28dcf87f9 include/pmodule.h
---- a/include/pmodule.h        Sun Jul 26 15:36:00 2009 +0200
-+++ b/include/pmodule.h        Sun Aug 02 19:10:30 2009 +0100
-@@ -65,6 +65,12 @@
- E void handle_setlogin(sourceinfo_t *si, user_t *u, char *login, time_t ts);
+diff --git a/include/pmodule.h b/include/pmodule.h
+index 7081dad..0bdafe2 100644
+--- a/include/pmodule.h
++++ b/include/pmodule.h
+@@ -65,6 +65,12 @@ E void handle_setlogin(sourceinfo_t *si, user_t *u, const char *login, time_t ts
+ E void handle_certfp(sourceinfo_t *si, user_t *u, const char *certfp);
  E void handle_clearlogin(sourceinfo_t *si, user_t *u);
  
 +typedef struct {
@@ -14,25 +15,27 @@ diff -r 64a28dcf87f9 include/pmodule.h
  #endif
  
  /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
-diff -r 64a28dcf87f9 modules/protocol/ts6-generic.c
---- a/modules/protocol/ts6-generic.c   Sun Jul 26 15:36:00 2009 +0200
-+++ b/modules/protocol/ts6-generic.c   Sun Aug 02 19:10:30 2009 +0100
-@@ -1142,12 +1142,23 @@
+diff --git a/modules/protocol/ts6-generic.c b/modules/protocol/ts6-generic.c
+index 4704923..04998dc 100644
+--- a/modules/protocol/ts6-generic.c
++++ b/modules/protocol/ts6-generic.c
+@@ -1254,15 +1254,24 @@ static void m_encap(sourceinfo_t *si, int parc, char *parv[])
        }
        else if (!irccasecmp(parv[1], "CHGHOST"))
        {
 +              hook_incoming_host_change_t hdata;
-+              char oldvhost[HOSTLEN];
++              char *oldvhost;
 +
                if (parc < 4)
                        return;
                u = user_find(parv[2]);
                if (u == NULL)
                        return;
-+
-+              strlcpy(oldvhost, u->vhost, HOSTLEN);
-               strlcpy(u->vhost, parv[3], HOSTLEN);
-+
++              oldvhost = strshare_get(u->vhost);
+               strshare_unref(u->vhost);
+               u->vhost = strshare_get(parv[3]);
 +              hdata.si = si;
 +              hdata.user = u;
 +              hdata.oldvhost = oldvhost;
@@ -41,23 +44,3 @@ diff -r 64a28dcf87f9 modules/protocol/ts6-generic.c
                slog(LG_DEBUG, "m_encap(): chghost %s -> %s", u->nick,
                                u->vhost);
        }
-@@ -1254,11 +1265,19 @@
- static void m_chghost(sourceinfo_t *si, int parc, char *parv[])
- {
-       user_t *u = user_find(parv[0]);
-+      hook_incoming_host_change_t hdata;
-+      char oldvhost[HOSTLEN];
-       if (!u)
-               return;
-+              strlcpy(oldvhost, u->vhost, HOSTLEN);
-       strlcpy(u->vhost, parv[1], HOSTLEN);
-+
-+      hdata.si = si;
-+      hdata.user = u;
-+      hdata.oldvhost = oldvhost;
-+      hook_call_event("incoming_host_change", &hdata);
- }
- static void m_motd(sourceinfo_t *si, int parc, char *parv[])