01a692ab5b
Added tests for the word filter store. Added qgen.NewAcc() to reduce the amount of boilerplate needed for creating an accumulator. Exposed the RecordError method on the accumulator. Added an Add method to PluginList and removed AddPlugin() in favour of that. More panel buttons on Nox should be styled now. Added the panel_update_button_text phrase for future use. More errors might be caught in the thumbnailer now. Removed ls from .travis.yml, it was there for debugging Code Climate.
27 lines
868 B
Go
27 lines
868 B
Go
package main
|
|
|
|
import "./common"
|
|
|
|
func init() {
|
|
common.Plugins.Add(&common.Plugin{UName: "heythere", Name: "Hey There", Author: "Azareal", URL: "https://github.com/Azareal", Init: initHeythere, Deactivate: deactivateHeythere})
|
|
}
|
|
|
|
// init_heythere is separate from init() as we don't want the plugin to run if the plugin is disabled
|
|
func initHeythere() error {
|
|
common.Plugins["heythere"].AddHook("topic_reply_row_assign", heythereReply)
|
|
return nil
|
|
}
|
|
|
|
func deactivateHeythere() {
|
|
common.Plugins["heythere"].RemoveHook("topic_reply_row_assign", heythereReply)
|
|
}
|
|
|
|
func heythereReply(data ...interface{}) interface{} {
|
|
currentUser := data[0].(*common.TopicPage).Header.CurrentUser
|
|
reply := data[1].(*common.ReplyUser)
|
|
reply.Content = "Hey there, " + currentUser.Name + "!"
|
|
reply.ContentHtml = "Hey there, " + currentUser.Name + "!"
|
|
reply.Tag = "Auto"
|
|
return nil
|
|
}
|