would fail oddly and leave you with dozens of empty Citadel groups. The name of
the group that new buddies are put in is now taken from the friendly name of
the server (so it's not just Citadel any more). Debug information now get
newlines. Lucky debug information.
local _
local username, servername, port
local _
local username, servername, port
+local serverfriendlyname
local ga, gc
local fd, gsc
local timerhandle
local ga, gc
local fd, gsc
local timerhandle
table.insert(s, tostring(i))
end
s = table.concat(s)
table.insert(s, tostring(i))
end
s = table.concat(s)
- gaim_debug_info("citadel", (string.gsub(s, "%%", "%%")))
+ gaim_debug_info("citadel", string.gsub(s, "%%", "%%").."\n")
end
local function unexpectederror()
end
local function unexpectederror()
if noblist then
if not gaim_find_buddy(ga, s) then
if noblist then
if not gaim_find_buddy(ga, s) then
+ log("trying to add new buddy ", s)
local buddy = gaim_buddy_new(ga, s, s)
local buddy = gaim_buddy_new(ga, s, s)
- local group = gaim_group_new("Citadel")
if buddy then
-- buddy is not garbage collected! This must succeed!
if buddy then
-- buddy is not garbage collected! This must succeed!
+ local group = gaim_find_group(serverfriendlyname)
+ if not group then
+ group = gaim_group_new(serverfriendlyname)
+ gaim_blist_add_group(group, nil)
+ end
+
gaim_blist_add_buddy(buddy, nil, group, nil)
gaim_blist_add_buddy(buddy, nil, group, nil)
+ else
+ warning("Unable to add "..s.." to your buddy list. This error should never happen.")
+ break
gc = gaim_account_get_connection(ga)
queue(function()
gc = gaim_account_get_connection(ga)
queue(function()
username = gaim_account_get_username(ga)
_, _, username, servername = string.find(username, "^(.*)@(.*)$")
username = gaim_account_get_username(ga)
_, _, username, servername = string.find(username, "^(.*)@(.*)$")
+ serverfriendlyname = servername
port = gaim_account_get_int(ga, "port", CITADEL_DEFAULT_PORT)
noblist = gaim_account_get_bool(ga, "no_blist", false)
port = gaim_account_get_int(ga, "port", CITADEL_DEFAULT_PORT)
noblist = gaim_account_get_bool(ga, "no_blist", false)
writeline("IDEN 226|0|"..VERSION_NUMBER.."|Gaim Citadel plugin|")
m = get_response()
writeline("IDEN 226|0|"..VERSION_NUMBER.."|Gaim Citadel plugin|")
m = get_response()
- -- Set asynchronous mode.
+ -- Get information about the Citadel server.
gaim_connection_update_progress(gc, "Setting up", 7, STEPS)
gaim_connection_update_progress(gc, "Setting up", 7, STEPS)
+ writeline("INFO")
+ m = get_response()
+ serverfriendlyname = m.xargs[3]
+
+ -- Set asynchronous mode.
+
+ gaim_connection_update_progress(gc, "Setting up", 8, STEPS)
writeline("ASYN 1")
m = get_response()
if (m.response ~= CIT_OK) then
writeline("ASYN 1")
m = get_response()
if (m.response ~= CIT_OK) then
(function()
-- Switch to private configuration room.
(function()
-- Switch to private configuration room.
- gaim_connection_update_progress(gc, "Setting up", 8, STEPS)
+ gaim_connection_update_progress(gc, "Setting up", 9, STEPS)
writeline("GOTO "..CITADEL_CONFIG_ROOM.."||1")
m = get_response()
if (m.response ~= CIT_OK) then
writeline("GOTO "..CITADEL_CONFIG_ROOM.."||1")
m = get_response()
if (m.response ~= CIT_OK) then
-- Look for our preferences.
-- Look for our preferences.
- gaim_connection_update_progress(gc, "Setting up", 9, STEPS)
+ gaim_connection_update_progress(gc, "Setting up", 10, STEPS)
writeline("MSGS ALL|0|1")
m = get_response()
if (m.response ~= START_CHAT_MODE) then
writeline("MSGS ALL|0|1")
m = get_response()
if (m.response ~= START_CHAT_MODE) then
- gaim_connection_update_progress(gc, "Setting up", 10, STEPS)
+ gaim_connection_update_progress(gc, "Setting up", 11, STEPS)
writeline("MSG0 "..m)
while true do
local s = readline()
writeline("MSG0 "..m)
while true do
local s = readline()
-- Update buddy list with who's online.
-- Update buddy list with who's online.
- gaim_connection_update_progress(gc, "Setting up", 11, STEPS)
+ gaim_connection_update_progress(gc, "Setting up", 12, STEPS)
update_buddy_status()
-- Go back to the Lobby.
update_buddy_status()
-- Go back to the Lobby.
- gaim_connection_update_progress(gc, "Setting up", 12, STEPS)
+ gaim_connection_update_progress(gc, "Setting up", 13, STEPS)
writeline("GOTO "..WAITING_ROOM)
get_response()
writeline("GOTO "..WAITING_ROOM)
get_response()
- gaim_connection_update_progress(gc, "Connected", 13, STEPS)
+ gaim_connection_update_progress(gc, "Connected", 14, STEPS)
gaim_connection_set_state(gc, GAIM_CONNECTED)
end)
end
gaim_connection_set_state(gc, GAIM_CONNECTED)
end)
end