[READ-ONLY] Mirror of https://github.com/VibeDevelopers/atheme. Modified fork of atheme IRC Services www.vibetalk.net/
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #936 from SadieCat/inspircd

Fix various minor issues with the InspIRCd protocol module

authored by

alyx and committed by
GitHub
(Jan 19, 2025, 9:25 AM -0600) 4d6dbd7c 03293e02

+31 -10
+31 -10
modules/protocol/inspircd.c
··· 385 385 static void 386 386 inspircd_wallops_sts(const char *text) 387 387 { 388 + if (!me.recvsvr) 389 + return; // not allowed until connected 390 + 388 391 if (has_globopsmod) 389 392 sts(":%s SNONOTICE g :%s", me.numeric, text); 390 393 else ··· 517 520 } 518 521 519 522 if (has_cbanmod) 520 - sts(":%s CBAN %s %ld :%s", svs != NULL ? svs->me->uid : ME, name, duration, reason); 523 + sts(":%s ADDLINE CBAN %s %s %lu %ld :%s", me.numeric, name, svs != NULL ? svs->nick : me.name, (unsigned long)CURRTIME, duration, reason); 521 524 else 522 525 slog(LG_INFO, "SQLINE: Could not set SQLINE on \2%s\2 due to m_cban not being loaded in inspircd.", name); 523 526 } ··· 532 535 } 533 536 534 537 if (has_cbanmod) 535 - sts(":%s CBAN %s", ME, name); 538 + sts(":%s DELLINE CBAN %s", ME, name); 536 539 else 537 540 slog(LG_INFO, "SQLINE: Could not remove SQLINE on \2%s\2 due to m_cban not being loaded in inspircd.", name); 538 541 } ··· 621 624 static void 622 625 inspircd_on_login(struct user *u, struct myuser *mu, const char *wantedhost) 623 626 { 627 + sts(":%s METADATA %s accountid :%s", me.numeric, u->uid, config_options.show_entity_id ? entity(mu)->id : ""); 624 628 sts(":%s METADATA %s accountname :%s", me.numeric, u->uid, entity(mu)->name); 625 629 } 626 630 627 631 static bool 628 632 inspircd_on_logout(struct user *u, const char *account) 629 633 { 634 + sts(":%s METADATA %s accountid :", me.numeric, u->uid); 630 635 sts(":%s METADATA %s accountname :", me.numeric, u->uid); 631 636 return false; 632 637 } ··· 797 802 { 798 803 struct channel *c = channel_find(parv[0]); 799 804 time_t ts = atol(parv[2]); 805 + const char *setter; 800 806 801 807 if (!c) 802 808 return; ··· 807 813 return; 808 814 } 809 815 810 - handle_topic_from(si, c, parv[3], ts, parv[4]); 816 + if (si->su) 817 + { 818 + // topic is being set by a user 819 + setter = si->su->nick; 820 + } 821 + else 822 + { 823 + // topic is being set by a server on burst 824 + setter = parv[3]; 825 + } 826 + 827 + handle_topic_from(si, c, setter, ts, parv[parc - 1]); 811 828 } 812 829 813 830 static void ··· 832 849 handle_eob(si->s); 833 850 834 851 me.uplinkpong = CURRTIME; 835 - 836 - // if pong source isn't origin, this isn't a complete burst. --nenolod 837 - if (s != si->s) 838 - return; 839 852 840 853 // -> :test.projectxero.net PONG test.projectxero.net :shrike.malkier.net 841 854 if (me.bursting) ··· 897 910 { 898 911 if (status_mode_list[j].value == prefix_mode_list[k].value) 899 912 { 913 + slog(LG_DEBUG, "map_a_prefix(): %c -> %c", prefix, prefix_mode_list[k].mode); 900 914 prefixandnick[*nlen] = prefix_mode_list[k].mode; 901 915 (*nlen)++; 902 916 return; ··· 1041 1055 // :<uid> IJOIN <chan> <membid> [<ts> [<flags>]] 1042 1056 struct channel *c; 1043 1057 char prefixandnick[51]; 1058 + unsigned int plen; 1044 1059 1045 1060 c = channel_find(parv[0]); 1046 1061 if (c == NULL) ··· 1055 1070 return; 1056 1071 } 1057 1072 1058 - mowgli_strlcpy(prefixandnick, parv[3], sizeof(prefixandnick)); 1059 - mowgli_strlcpy(prefixandnick + strlen(parv[3]), si->su->nick, sizeof(prefixandnick) - strlen(parv[3])); 1073 + plen = 0; 1074 + for (; *parv[3]; parv[3]++) 1075 + { 1076 + // atheme wants prefix characters but inspircd sends prefix modes 1077 + map_a_prefix(*parv[3], prefixandnick, &plen); 1078 + } 1079 + 1080 + mowgli_strlcpy(prefixandnick + plen, si->su->nick, sizeof(prefixandnick) - plen); 1060 1081 chanuser_add(c, prefixandnick); 1061 1082 } 1062 1083 ··· 1797 1818 pcommand_add("STATS", m_stats, 2, MSRC_USER); 1798 1819 pcommand_add("MOTD", m_motd, 1, MSRC_USER); 1799 1820 pcommand_add("ADMIN", m_admin, 1, MSRC_USER); 1800 - pcommand_add("FTOPIC", m_ftopic, 5, MSRC_SERVER); 1821 + pcommand_add("FTOPIC", m_ftopic, 4, MSRC_USER | MSRC_SERVER); 1801 1822 pcommand_add("ERROR", m_error, 1, MSRC_UNREG | MSRC_SERVER); 1802 1823 pcommand_add("FIDENT", m_fident, 1, MSRC_USER); 1803 1824 pcommand_add("FHOST", m_fhost, 1, MSRC_USER);