view 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
line wrap: on
line source
-- A Twitter client of sorts for World of Warcraft
-- Author: Wobin
-- Email: wobster@gmail.com
--
Squawk = LibStub("AceAddon-3.0"):NewAddon("Squawk")

Squawk.Model = {}
Squawk.View = {}
Squawk.Controller = {}

local Model = Squawk.Model
local View = Squawk.View
local Controller = Squawk.Controller

Model.UserSettings = {}
local Settings = Model.UserSettings

local defaults = {
	profile = {
		Squawks = {},
		Squawkers = {},
		Follower = {},
		Following = {},
		Pending = {},
		Requested = {},
		Blocked = {},
	}
}
local SquawkViewMeta = { __tostring = function() return "SquawkView" end }

function Squawk:OnInitialize()
	Model.db = LibStub("AceDB-3.0"):New("SquawkDB", defaults)
	Model.Squawks.Main = Model.db.profile.Squawks
	Model.Squawks.Squawkers = Model.db.profile.Squawkers
	Settings.Follower = Model.db.profile.Follower
	Settings.Following = Model.db.profile.Following
	Settings.Pending = Model.db.profile.Pending
	Settings.Requested = Model.db.profile.Requested
	Settings.Blocked = Model.db.profile.Blocked
	Settings.Private = Model.db.profile.Private
	
	LibStub("AceComm-3.0"):Embed(Controller)
	LibStub("AceTimer-3.0"):Embed(Controller)
	Controller:RegisterComm("Squawk", Controller.ReceiveMessage)
	LibStub("AceConsole-3.0"):Embed(View)
	setmetatable(View, SquawkViewMeta)

	Controller.Name = UnitName("player")
	_, Controller.Class = UnitClass("player")

	Model.Squawks.Reload(Model.Squawks) -- Retrain the table lookups
end