View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001679 | Anope Stable (2.0.x series) | General | public | 2016-05-28 21:53 | 2016-11-05 16:37 |
Reporter | capitaine | Assigned To | Adam | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Summary | 0001679: IRC2SQL does not update status modes | ||||
Description | From IRC2SQL, users status modes like +vho are updated only on join, but not when staying in a channel. | ||||
Steps To Reproduce | /MODE #Foo +vho John mysql> SELECT i.modes FROM irc_user AS u, irc_ison AS i, irc_chan AS c WHERE u.nick = "John" AND c.channel = "#Foo" AND u.nickid = i.nickid AND c.chanid = i.chanid; +-------+ | modes | +-------+ | | +-------+ | ||||
Additional Information | Suggested fix attached | ||||
Tags | No tags attached. | ||||
|
Thanks, fixed in a5fdf7c546ccb0f70a70543ea8afb54d155a13cc |
|
Didn't notice you used another table, Im use to JOINs on other tables :P |
|
I know, my report is about ison.modes, not tables channels.modes nor user.modes |
|
That table has modes for user modes, not channel modes. The Channel modes you seek are in the "ison" table. |
|
0001-IRC2SQL-update-status-modes.patch (1,712 bytes)
From 29d502ce7495ed9dc348184abd5563fe3bd81d28 Mon Sep 17 00:00:00 2001 From: Capitaine Date: Sat, 28 May 2016 22:08:38 +0200 Subject: [PATCH] IRC2SQL update status modes --- modules/extra/stats/irc2sql/irc2sql.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp index a001813..b510443 100644 --- a/modules/extra/stats/irc2sql/irc2sql.cpp +++ b/modules/extra/stats/irc2sql/irc2sql.cpp @@ -223,10 +223,29 @@ void IRC2SQL::OnJoinChannel(User *u, Channel *c) EventReturn IRC2SQL::OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) { - query = "UPDATE `" + prefix + "chan` SET modes=@modes@ WHERE channel=@channel@"; - query.SetValue("channel", c->name); - query.SetValue("modes", c->GetModes(true,true)); - this->RunQuery(query); + User *u = NULL; + if (!param.empty() && (u = User::Find(param, false))) + { + ChanUserContainer *cc = u->FindChannel(c); + if (cc) + { + query = "UPDATE `" + prefix + "user` AS u, `" + prefix + "ison` AS i, `" + prefix + "chan` AS c" + " SET i.modes=@modes@" + " WHERE u.nick=@nick@ AND c.channel=@channel@" + " AND u.nickid = i.nickid AND c.chanid = i.chanid"; + query.SetValue("nick", u->nick); + query.SetValue("modes", cc->status.Modes()); + query.SetValue("channel", c->name); + this->RunQuery(query); + } + } + else + { + query = "UPDATE `" + prefix + "chan` SET modes=@modes@ WHERE channel=@channel@"; + query.SetValue("channel", c->name); + query.SetValue("modes", c->GetModes(true,true)); + this->RunQuery(query); + } return EVENT_CONTINUE; } -- 2.1.4 |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-05-28 21:53 | capitaine | New Issue | |
2016-05-28 21:53 | capitaine | File Added: 0001-IRC2SQL-update-status-modes.patch | |
2016-05-28 21:58 | cronus | Note Added: 0006793 | |
2016-05-28 22:07 | capitaine | Note Added: 0006794 | |
2016-05-29 02:54 | cronus | Note Added: 0006795 | |
2016-11-05 16:37 | Adam | Note Added: 0006814 | |
2016-11-05 16:37 | Adam | Status | new => resolved |
2016-11-05 16:37 | Adam | Resolution | open => fixed |
2016-11-05 16:37 | Adam | Assigned To | => Adam |