annotate Squawk.lua @ 19:431f2fce08f2

Added in link stripping Coloured class names Reply to specific squawk Related squawks fixed new arrow to indicate reply limit to 140 characters
author wobin
date Tue, 12 May 2009 00:57:59 +1000
parents a3328fffef5c
children 22178ac75587
rev   line source
wobin@18 1 -- A Twitter client of sorts for World of Warcraft
wobin@18 2 -- Author: Wobin
wobin@18 3 -- Email: wobster@gmail.com
wobin@18 4 --
wobin@18 5 Squawk = LibStub("AceAddon-3.0"):NewAddon("Squawk")
wobin@18 6
wobin@18 7 Squawk.Model = {}
wobin@18 8 Squawk.View = {}
wobin@18 9 Squawk.Controller = {}
wobin@18 10
wobin@18 11 local Model = Squawk.Model
wobin@18 12 local View = Squawk.View
wobin@18 13 local Controller = Squawk.Controller
wobin@18 14
wobin@18 15 Model.UserSettings = {}
wobin@18 16 local Settings = Model.UserSettings
wobin@18 17
wobin@18 18 local defaults = {
wobin@18 19 profile = {
wobin@18 20 Squawks = {},
wobin@19 21 Squawkers = {},
wobin@18 22 Follower = {},
wobin@18 23 Following = {},
wobin@18 24 Pending = {},
wobin@18 25 Requested = {},
wobin@18 26 Blocked = {},
wobin@18 27 }
wobin@18 28 }
wobin@18 29 local SquawkViewMeta = { __tostring = function() return "SquawkView" end }
wobin@18 30
wobin@18 31 function Squawk:OnInitialize()
wobin@18 32 Model.db = LibStub("AceDB-3.0"):New("SquawkDB", defaults)
wobin@18 33 Model.Squawks.Main = Model.db.profile.Squawks
wobin@19 34 Model.Squawks.Squawkers = Model.db.profile.Squawkers
wobin@18 35 Settings.Follower = Model.db.profile.Follower
wobin@18 36 Settings.Following = Model.db.profile.Following
wobin@18 37 Settings.Pending = Model.db.profile.Pending
wobin@18 38 Settings.Requested = Model.db.profile.Requested
wobin@18 39 Settings.Blocked = Model.db.profile.Blocked
wobin@18 40 Settings.Private = Model.db.profile.Private
wobin@18 41
wobin@18 42 LibStub("AceComm-3.0"):Embed(Controller)
wobin@18 43 LibStub("AceTimer-3.0"):Embed(Controller)
wobin@18 44 Controller:RegisterComm("Squawk", Controller.ReceiveMessage)
wobin@18 45 LibStub("AceConsole-3.0"):Embed(View)
wobin@18 46 setmetatable(View, SquawkViewMeta)
wobin@18 47
wobin@19 48 Controller.Name = UnitName("player")
wobin@19 49 _, Controller.Class = UnitClass("player")
wobin@19 50
wobin@18 51 Model.Squawks.Reload(Model.Squawks) -- Retrain the table lookups
wobin@18 52 end