Commit 2a6fc07b authored by Per Cederqvist's avatar Per Cederqvist

Log changed names.

* src/server/conference.c: Don't include s-string.h twice, but do
include string-malloc.h.
(change_name): Log the old and new name, and the user that changes
it.
* src/server/testsuite/lyskomd.0/03.exp: Be prepared for the new
log message.
* src/server/testsuite/lyskomd.0/06.exp: Ditto.
* src/server/testsuite/lyskomd.0/13.exp: Ditto.
* src/server/testsuite/lyskomd.0/send-async-cov.exp: Ditto.
parent 09b82590
2006-07-27 Per Cederqvist <ceder@lysator.liu.se>
Log changed names.
* src/server/conference.c: Don't include s-string.h twice, but do
include string-malloc.h.
(change_name): Log the old and new name, and the user that changes
it.
* src/server/testsuite/lyskomd.0/03.exp: Be prepared for the new
log message.
* src/server/testsuite/lyskomd.0/06.exp: Ditto.
* src/server/testsuite/lyskomd.0/13.exp: Ditto.
* src/server/testsuite/lyskomd.0/send-async-cov.exp: Ditto.
2006-07-26 Per Cederqvist <ceder@lysator.liu.se>
Improve doc. (Bug 144, partially).
......
......@@ -43,7 +43,6 @@
#include "kom-types.h"
#include "log.h"
#include "services.h"
#include "s-string.h"
#include "cache.h"
#include "misc-types.h"
#include "s-collat-tabs.h"
......@@ -65,6 +64,7 @@
#include "local-to-global.h"
#include "server-time.h"
#include "stats.h"
#include "string-malloc.h"
BUGDECL;
......@@ -401,6 +401,7 @@ change_name (Conf_no conf_no,
{
Conference * conf_c;
enum access acc;
char *name;
CHK_CONNECTION(FAILURE);
CHK_LOGIN(FAILURE);
......@@ -437,6 +438,22 @@ change_name (Conf_no conf_no,
}
async_new_name(conf_no, conf_c->name, new_name);
kom_log("User %ld changed the name of conference %ld.\n",
(long)ACTPERS, (long)conf_no);
name = s_crea_c_str(conf_c->name);
if (name != NULL)
{
kom_log("Old name: '%s'.\n", name);
string_free(name);
}
name = s_crea_c_str(new_name);
if (name != NULL)
{
kom_log("New name: '%s'.\n", name);
string_free(name);
}
s_strcpy(&conf_c->name, new_name);
mark_conference_as_changed(conf_no);
......
......@@ -338,6 +338,9 @@ simple_expect "%1050 20 0"
send "1051 3 7 [holl "PRIMa musik"]\n"
simple_expect ":3 5 7 [holl ".So called. Christian Music"] [holl "PRIMa musik"]"
simple_expect "=1051"
lyskomd_expect "User 6 changed the name of conference 7\\."
lyskomd_expect "Old name: '\\(So called\\) Christian Music'\\."
lyskomd_expect "New name: 'PRIMa musik'\\."
talk_to client 1
simple_expect ":3 5 7 [holl ".So called. Christian Music"] [holl "PRIMa musik"]"
......
......@@ -530,6 +530,9 @@ talk_to client 2
send "1060 3 10 [holl "NN"]\n"
simple_expect ":3 5 10 [holl "C10"] [holl "NN"]"
simple_expect "=1060"
lyskomd_expect "User 5 changed the name of conference 10\\."
lyskomd_expect "Old name: 'C10'\\."
lyskomd_expect "New name: 'NN'\\."
talk_to client 1
kom_ping_server
......@@ -545,6 +548,9 @@ talk_to client 3
send "1061 3 10 [holl "C10"]\n"
simple_expect ":3 5 10 [holl "NN"] [holl "C10"]"
simple_expect "=1061"
lyskomd_expect "User 7 changed the name of conference 10\\."
lyskomd_expect "Old name: 'NN'\\."
lyskomd_expect "New name: 'C10'\\."
talk_to client 0
kom_ping_server
......
......@@ -49,18 +49,27 @@ simple_expect "=1001 4 { [holl "Match 6"] 0000 6 [holl "Match 7"] 0000 7 [holl "
send "1002 3 6 [holl "Junk 6"]\n"
simple_expect "=1002"
lyskomd_expect "User 5 changed the name of conference 6\\."
lyskomd_expect "Old name: 'Match 6'\\."
lyskomd_expect "New name: 'Junk 6'\\."
send "1003 76 [holl "Match"] 1 1\n"
simple_expect "=1003 3 { [holl "Match 7"] 0000 7 [holl "Match 8"] 0000 8 [holl "Match 9"] 0000 9 }"
send "1004 3 8 [holl "Junk 8"]\n"
simple_expect "=1004"
lyskomd_expect "User 5 changed the name of conference 8\\."
lyskomd_expect "Old name: 'Match 8'\\."
lyskomd_expect "New name: 'Junk 8'\\."
send "1005 76 [holl "Match"] 1 1\n"
simple_expect "=1005 2 { [holl "Match 7"] 0000 7 [holl "Match 9"] 0000 9 }"
send "1006 3 7 [holl "Junk 7"]\n"
simple_expect "=1006"
lyskomd_expect "User 5 changed the name of conference 7\\."
lyskomd_expect "Old name: 'Match 7'\\."
lyskomd_expect "New name: 'Junk 7'\\."
send "1007 76 [holl "Match"] 1 1\n"
simple_expect "=1007 1 { [holl "Match 9"] 0000 9 }"
......
......@@ -90,6 +90,10 @@ Open files: [expr $PROTECTED_FDS + 4]"
simple_expect ":3 5 5 [holl "Administratr .fr. LysKOM"] [holl "Nameless Thing"]"
}
simple_expect "=1002"
lyskomd_expect "User 5 changed the name of conference 5\\."
lyskomd_expect "Old name: 'Administratr \\(fr\\) LysKOM'\\."
lyskomd_expect "New name: 'Nameless Thing'\\."
# Test async 6
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment