summaryrefslogtreecommitdiff
path: root/src/chat
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-21 16:20:55 +0000
committerPaul Buetow <paul@buetow.org>2010-11-21 16:20:55 +0000
commit6fde6b0fe90abde84011202edd40fe46eb06af44 (patch)
treeef760338c50b4df3ae9cca96347bca962fdbec7e /src/chat
parent55b08bd93257d32df76efc4e8e3f49311c39ee82 (diff)
Diffstat (limited to 'src/chat')
-rw-r--r--src/chat/base.h5
-rw-r--r--src/chat/base.tmpl9
-rw-r--r--src/chat/chat.cpp55
-rw-r--r--src/chat/chat.h3
-rw-r--r--src/chat/gcol.cpp44
-rw-r--r--src/chat/gcol.h4
-rw-r--r--src/chat/perm.cpp3
-rw-r--r--src/chat/perm.h3
-rw-r--r--src/chat/room.cpp18
-rw-r--r--src/chat/room.h5
-rw-r--r--src/chat/sess.cpp5
-rw-r--r--src/chat/sess.h3
-rw-r--r--src/chat/sman.cpp21
-rw-r--r--src/chat/sman.h4
-rw-r--r--src/chat/user.cpp307
-rw-r--r--src/chat/user.h109
16 files changed, 349 insertions, 249 deletions
diff --git a/src/chat/base.h b/src/chat/base.h
index bba37e0..145fb6c 100644
--- a/src/chat/base.h
+++ b/src/chat/base.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/base.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -44,7 +43,7 @@ public:
static string to_lower( string s )
{
string s_tmp("");
- for (int i=0;i < s.size() ;i++)
+ for(int i=0;i < s.size() ;i++)
s_tmp=s_tmp+(char)tolower(s.at(i));
return s_tmp;
}
diff --git a/src/chat/base.tmpl b/src/chat/base.tmpl
index 9b1d682..a8db1a0 100644
--- a/src/chat/base.tmpl
+++ b/src/chat/base.tmpl
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/base.tmpl
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -66,20 +65,20 @@ void
base<type>::dumpit()
{
dumpable::add
- ("[base]");
+ ("[base]");
vector<string>* p_vec = nhashmap<type*>::get_key_vector();
vector<string>::iterator iter;
for (iter = p_vec->begin(); iter != p_vec->end(); ++iter)
{
dumpable::add
- (*iter);
+ (*iter);
type* p_elem = get_elem(*iter);
if (p_elem)
{
dumpable::next_no_newline();
dumpable::add
- (p_elem->dump(dumpable::get_level()));
+ (p_elem->dump(dumpable::get_level()));
}
}
diff --git a/src/chat/chat.cpp b/src/chat/chat.cpp
index cea9ab6..066bfbc 100644
--- a/src/chat/chat.cpp
+++ b/src/chat/chat.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/chat.cpp
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -37,15 +36,12 @@ using namespace std;
chat::chat( )
{
- {
- // Set up replace strings;
+ { // Set up replace strings;
wrap::system_message(CHATREP);
vector<string>* p_vec_keys = wrap::CONF->get_key_vector();
- for (vector<string>::iterator iter = p_vec_keys->
- begin();
- iter != p_vec_keys->end();
- iter++ )
+ for (vector<string>::iterator iter = p_vec_keys-> begin();
+ iter != p_vec_keys->end(); iter++ )
{
if ( iter->length() >= 24 && iter->compare( 0, 22, "chat.html.replace.from" ) == 0 )
{
@@ -150,9 +146,17 @@ chat::login( map<string,string> &map_params )
return;
}
- // prove if nick is banned from chat
- if (map_banned_nicks.exists(tool::to_lower(s_user)))
+ // prove if maxpoolsize (threads) allows this login
+ else if ( !pool::allow_user_login() )
{
+ map_params["INFO"] = wrap::CONF->get_elem( "chat.msgs.err.maxuserlimit" );
+ map_params["request"] = wrap::CONF->get_elem( "httpd.startsite" ); // redirect to the startpage.
+ wrap::system_message( LOGINE5 + s_user);
+ return;
+ }
+
+ // prove if nick is banned from chat
+ if (map_banned_nicks.exists(tool::to_lower(s_user))) {
map_params["INFO"] = wrap::CONF->get_elem( "chat.msgs.err.banned" );
map_params["request"] = wrap::CONF->get_elem( "httpd.startsite" );
return;
@@ -220,8 +224,7 @@ chat::login( map<string,string> &map_params )
return;
}
else
- {
- // If registered use saved options
+ { // If registered use saved options
map_params["registered"] = "yes";
map_params["color1"] = map_results["color1"];
map_params["color2"] = map_results["color2"];
@@ -232,8 +235,7 @@ chat::login( map<string,string> &map_params )
else
#endif
- {
- // If not registered prove if guest chatting is enabled.
+ { // If not registered prove if guest chatting is enabled.
if (wrap::CONF->get_elem("chat.enableguest") != "true")
{
map_params["INFO"] = wrap::CONF->get_elem( "chat.msgs.err.noguest" );
@@ -302,7 +304,7 @@ chat::login( map<string,string> &map_params )
// Now we will store all wanted user data into MySQL after logging out! (recycled user already have this set)
p_user->set_changed_data_on();
}
- p_room->msg_post(&s_msg);
+ p_room->msg_post( &s_msg );
}
void
@@ -355,8 +357,8 @@ chat::post( user* p_user, map<string,string> &map_params )
if (p_user->get_is_gag())
{
- p_user->msg_post(wrap::CONF->colored_error_msg("chat.msgs.err.gagged"));
- return;
+ p_user->msg_post(wrap::CONF->colored_error_msg("chat.msgs.err.gagged"));
+ return;
}
@@ -399,30 +401,28 @@ void
chat::dumpit()
{
dumpable::add
- ("[chat]");
+ ("[chat]");
base<room>::dumpit();
}
string
-chat::ban_nick(string &s_nick, string s_reason)
-{
+chat::ban_nick(string &s_nick, string s_reason) {
string s_lower_nick(tool::to_lower(s_nick));
if (map_banned_nicks.exists(s_lower_nick))
- return map_banned_nicks.get_elem(s_lower_nick);
-
+ return map_banned_nicks.get_elem(s_lower_nick);
+
map_banned_nicks.add_elem(s_reason, s_lower_nick);
return "";
}
string
-chat::unban_nick(string &s_nick)
-{
+chat::unban_nick(string &s_nick) {
string s_lower_nick(tool::to_lower(s_nick));
if (!map_banned_nicks.exists(s_lower_nick))
- return "";
-
+ return "";
+
string s_ret(map_banned_nicks.get_elem(s_lower_nick));
map_banned_nicks.del_elem(s_lower_nick);
@@ -430,8 +430,7 @@ chat::unban_nick(string &s_nick)
}
shashmap<string>*
-chat::get_map_banned_nicks()
-{
+chat::get_map_banned_nicks() {
return &map_banned_nicks;
}
diff --git a/src/chat/chat.h b/src/chat/chat.h
index edc5270..9da40e7 100644
--- a/src/chat/chat.h
+++ b/src/chat/chat.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/chat.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
diff --git a/src/chat/gcol.cpp b/src/chat/gcol.cpp
index dddb01d..ffdb8e5 100644
--- a/src/chat/gcol.cpp
+++ b/src/chat/gcol.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/gcol.cpp
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -32,30 +31,37 @@ using namespace std;
gcol::gcol()
{
+ pthread_mutex_init( &mut_vec_rooms , NULL);
p_map_users = new shashmap<user*>;
wrap::system_message( GARBAGE );
+
}
gcol::~gcol()
{
remove_garbage();
+ pthread_mutex_destroy( &mut_vec_rooms );
delete p_map_users;
}
void
gcol::add_room_to_garbage( room* p_room )
{
+ pthread_mutex_lock ( &mut_vec_rooms );
vec_rooms.push_back( p_room );
+ pthread_mutex_unlock( &mut_vec_rooms );
wrap::system_message( GARROOM + p_room->get_name() );
}
void
gcol::add_user_to_garbage( user* p_user )
{
- p_user->destroy_session();
+ p_user->s_mess_delete();
p_map_users->add_elem(p_user, tool::to_lower(p_user->get_name()));
wrap::system_message(GARUSER + p_user->get_name());
+ p_user->destroy_session();
+
}
bool
@@ -63,13 +69,16 @@ gcol::remove_garbage()
{
bool b_empty;
+ pthread_mutex_lock ( &mut_vec_rooms );
b_empty = ( vec_rooms.empty() && p_map_users->size() == 0);
+ pthread_mutex_unlock( &mut_vec_rooms );
if ( b_empty )
return false;
wrap::system_message( GARBACT );
+ pthread_mutex_lock ( &mut_vec_rooms );
for ( vector<room*>::iterator iter = vec_rooms.begin();
iter != vec_rooms.end(); iter++ )
{
@@ -77,6 +86,7 @@ gcol::remove_garbage()
delete *iter;
}
vec_rooms.clear();
+ pthread_mutex_unlock( &mut_vec_rooms );
p_map_users->run_func( delete_users_ );
@@ -88,12 +98,18 @@ gcol::remove_garbage()
room*
gcol::get_room_from_garbage()
{
+ pthread_mutex_lock ( &mut_vec_rooms );
if ( vec_rooms.empty() )
+ {
+ pthread_mutex_unlock( &mut_vec_rooms );
return NULL;
+ }
+
room* p_room = vec_rooms.back();
vec_rooms.pop_back();
+ pthread_mutex_unlock( &mut_vec_rooms );
return p_room;
}
@@ -111,17 +127,17 @@ gcol::get_room_from_garbage_or_new( string s_room )
user*
gcol::get_user_from_garbage( string s_user )
{
- user* p_user = p_map_users->get_elem(tool::to_lower(s_user));
+
+ user* p_user = p_map_users->get_elem( tool::to_lower(s_user) );
if ( p_user != NULL )
{
- p_map_users->del_elem(tool::to_lower(s_user));
- p_user->set_name(s_user);
- p_user->set_online(true);
- p_user->set_invisible(false);
- p_user->set_sock(NULL);
+ p_map_users->del_elem( tool::to_lower(s_user) );
+ p_user->set_name( s_user );
+ p_user->set_online( true );
+ p_user->set_invisible( false );
p_user->renew_timeout();
- wrap::system_message(GARUSE2 + p_user->get_name());
+ wrap::system_message(GARUSE2 + p_user->get_name() );
}
return p_user;
@@ -137,10 +153,14 @@ gcol::delete_users_( user *user_obj )
void
gcol::lock_mutex()
-{}
+{
+ pthread_mutex_lock ( &mut_vec_rooms );
+}
void
gcol::unlock_mutex()
-{}
+{
+ pthread_mutex_unlock ( &mut_vec_rooms );
+}
#endif
diff --git a/src/chat/gcol.h b/src/chat/gcol.h
index 710fc5f..bce0db0 100644
--- a/src/chat/gcol.h
+++ b/src/chat/gcol.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/gcol.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -42,6 +41,7 @@ private:
vector<room*> vec_rooms;
shashmap<user*>* p_map_users;
+ pthread_mutex_t mut_vec_rooms;
static void delete_users_( user* user_obj );
diff --git a/src/chat/perm.cpp b/src/chat/perm.cpp
index 8adb83f..544d2c0 100644
--- a/src/chat/perm.cpp
+++ b/src/chat/perm.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/perm.cpp
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
diff --git a/src/chat/perm.h b/src/chat/perm.h
index bac038e..709b60e 100644
--- a/src/chat/perm.h
+++ b/src/chat/perm.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/perm.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
diff --git a/src/chat/room.cpp b/src/chat/room.cpp
index 39177e7..a4d6549 100644
--- a/src/chat/room.cpp
+++ b/src/chat/room.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/room.cpp
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -33,6 +32,7 @@ using namespace std;
room::room( string s_name ) : name( s_name )
{
+ pthread_mutex_init( &mut_s_topic, NULL );
#ifdef LOGGING
p_logd = new logd( wrap::CONF->get_elem("chat.logging.roomlogdir") + get_lowercase_name(),
@@ -54,23 +54,29 @@ room::~room()
delete p_logd;
#endif
+ pthread_mutex_destroy( &mut_s_topic );
+ pthread_mutex_destroy( &mut_s_name );
}
string
room::get_topic()
{
string s_ret;
+ pthread_mutex_lock ( &mut_s_topic );
s_ret = s_topic;
+ pthread_mutex_unlock( &mut_s_topic );
return s_ret;
}
void
room::set_topic( string s_topic )
{
+ pthread_mutex_lock ( &mut_s_topic );
if ( s_topic == "" )
this->s_topic = "";
else
this->s_topic = s_topic + "<br><br>";
+ pthread_mutex_unlock( &mut_s_topic );
reload_onlineframe();
}
@@ -83,7 +89,9 @@ room::set_topic( string s_topic, string s_color )
void
room::clean_room()
{
+ pthread_mutex_lock ( &mut_s_topic );
this->s_topic = "";
+ pthread_mutex_unlock( &mut_s_topic );
wrap::CHAT->del_elem( get_lowercase_name() );
wrap::GCOL->add_room_to_garbage( this );
}
@@ -121,11 +129,11 @@ void
room::dumpit()
{
dumpable::add
- ("[room]");
+ ("[room]");
dumpable::add
- ("Name: "+get_name());
+ ("Name: "+get_name());
dumpable::add
- ("Topic: "+get_topic());
+ ("Topic: "+get_topic());
base<user>::dumpit();
}
diff --git a/src/chat/room.h b/src/chat/room.h
index 035633a..0988fd4 100644
--- a/src/chat/room.h
+++ b/src/chat/room.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/room.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -43,6 +42,7 @@ class room : public base<user>, public name
{
private:
string s_topic;
+ pthread_mutex_t mut_s_topic;
#ifdef LOGGING
logd* p_logd;
@@ -89,6 +89,7 @@ public:
#ifdef LOGGING
p_logd->log_simple_line( logd::remove_html_tags(*p_msg) );
#endif
+
base<user>::msg_post( p_msg );
}
diff --git a/src/chat/sess.cpp b/src/chat/sess.cpp
index 9ba5636..846876d 100644
--- a/src/chat/sess.cpp
+++ b/src/chat/sess.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/sess.cpp
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -80,7 +79,7 @@ sess::set_user(user* p_user)
/*
void
-sess::invalidate()
+sess::invalidate()
{
set_user(NULL);
set_tmpid("!invalidated");
diff --git a/src/chat/sess.h b/src/chat/sess.h
index d4e099f..db4ad11 100644
--- a/src/chat/sess.h
+++ b/src/chat/sess.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/sess.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
diff --git a/src/chat/sman.cpp b/src/chat/sman.cpp
index 8026497..187531d 100644
--- a/src/chat/sman.cpp
+++ b/src/chat/sman.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/sman.cpp
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -34,12 +33,14 @@
sman::sman()
{
i_continous_session_count = i_session_count = 0;
+ pthread_mutex_init( &mut_i_session_count, NULL );
}
sman::~sman()
{
// Delete each session object of the shashmap!
shashmap<sess*>::run_func( mtools<sess*>::delete_obj );
+ pthread_mutex_destroy( &mut_i_session_count );
}
string sman::generate_id( int i_len )
@@ -82,11 +83,13 @@ sess *sman::create_session( )
sess* p_sess = new sess( s_tmpid );
+ pthread_mutex_lock( &mut_i_session_count );
i_session_count++;
wrap::system_message(string(SESSIOC) + "(" +
- tool::int2string(++i_continous_session_count) + "," +
- tool::long2string((long)p_sess) + ")" );
+ tool::int2string(++i_continous_session_count) + "," +
+ tool::int2string(reinterpret_cast<int>(p_sess)) + ")" );
+ pthread_mutex_unlock( &mut_i_session_count );
//????
add_elem( p_sess, s_tmpid );
@@ -104,12 +107,14 @@ sman::destroy_session( string s_id )
{
sess* p_sess = get_elem(s_id);
+ pthread_mutex_lock( &mut_i_session_count );
i_session_count--;
wrap::system_message(string(SESSIOD) + "(" +
- tool::int2string(i_continous_session_count) + "," +
- tool::long2string((long)p_sess) + ")" );
+ tool::int2string(i_continous_session_count) + "," +
+ tool::int2string(reinterpret_cast<int>(p_sess)) + ")" );
+ pthread_mutex_unlock( &mut_i_session_count );
del_elem(s_id);
delete p_sess;
@@ -118,14 +123,16 @@ sman::destroy_session( string s_id )
int
sman::get_session_count()
{
+ pthread_mutex_lock( &mut_i_session_count );
int i_ret = i_session_count;
+ pthread_mutex_unlock( &mut_i_session_count );
return i_ret;
}
/*
void
sman::dump() {
- shashmap<sess*>::dump();
+ shashmap<sess*>::dump();
cout << "BLA" << endl;
}
*/
diff --git a/src/chat/sman.h b/src/chat/sman.h
index b8aff57..4526ade 100644
--- a/src/chat/sman.h
+++ b/src/chat/sman.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/sman.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -43,6 +42,7 @@ private:
int i_session_count;
int i_continous_session_count;
+ pthread_mutex_t mut_i_session_count;
public:
sman();
diff --git a/src/chat/user.cpp b/src/chat/user.cpp
index 80f4c65..93dd672 100644
--- a/src/chat/user.cpp
+++ b/src/chat/user.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/user.cpp
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -31,8 +30,6 @@
using namespace std;
-#include <errno.h>
-
user::user() : name( "" )
{
initialize();
@@ -44,7 +41,27 @@ user::user( string s_name ) : name( s_name )
}
user::~user()
-{}
+{
+ // pthread_mutex_destroy( & mut_map_mods );
+ pthread_mutex_destroy( & mut_away );
+ pthread_mutex_destroy( & mut_b_online );
+ pthread_mutex_destroy( & mut_b_fake );
+ pthread_mutex_destroy( & mut_b_invisible );
+ pthread_mutex_destroy( & mut_b_has_sess );
+ pthread_mutex_destroy( & mut_b_is_reg );
+ pthread_mutex_destroy( & mut_b_is_gag );
+ pthread_mutex_destroy( & mut_s_mess );
+ pthread_mutex_destroy( & mut_s_pass );
+ pthread_mutex_destroy( & mut_p_room );
+ pthread_mutex_destroy( & mut_s_col1 );
+ pthread_mutex_destroy( & mut_s_col2 );
+ pthread_mutex_destroy( & mut_s_email );
+ pthread_mutex_destroy( & mut_s_tmpid );
+ pthread_mutex_destroy( & mut_i_status );
+ pthread_mutex_destroy( & mut_map_changed_data );
+ pthread_cond_destroy ( &cond_message );
+ pthread_mutex_destroy( &mut_message );
+}
void
user::initialize()
@@ -54,10 +71,7 @@ user::initialize()
init_ints(wrap::CONF->get_vector("chat.fields.userints"));
init_bools(wrap::CONF->get_vector("chat.fields.userbools"));
- this -> l_messages_recv = 0;
- this -> p_sock = NULL;
this -> p_room = NULL;
- this -> s_msg = "";
this -> b_is_reg = false;
this -> b_is_gag = false;
this -> b_set_changed_data = false;
@@ -67,6 +81,25 @@ user::initialize()
this -> s_col1 = wrap::CONF->get_elem( "chat.html.user.color1" );
this -> s_col2 = wrap::CONF->get_elem( "chat.html.user.color2" );
+ // pthread_mutex_init( & mut_map_mods , NULL );
+ pthread_mutex_init( & mut_away , NULL );
+ pthread_mutex_init( & mut_b_online , NULL );
+ pthread_mutex_init( & mut_b_fake , NULL );
+ pthread_mutex_init( & mut_b_invisible , NULL );
+ pthread_mutex_init( & mut_b_has_sess , NULL );
+ pthread_mutex_init( & mut_b_is_reg , NULL );
+ pthread_mutex_init( & mut_b_is_gag , NULL );
+ pthread_mutex_init( & mut_s_mess , NULL );
+ pthread_mutex_init( & mut_s_pass , NULL );
+ pthread_mutex_init( & mut_p_room , NULL );
+ pthread_mutex_init( & mut_s_col1 , NULL );
+ pthread_mutex_init( & mut_s_col2 , NULL );
+ pthread_mutex_init( & mut_s_email , NULL );
+ pthread_mutex_init( & mut_s_tmpid , NULL );
+ pthread_mutex_init( & mut_i_status , NULL );
+ pthread_mutex_init( & mut_map_changed_data , NULL );
+ pthread_cond_init ( &cond_message, NULL);
+ pthread_mutex_init( &mut_message , NULL);
renew_timeout();
}
@@ -74,10 +107,9 @@ void
user::clean()
{
destroy_session();
- set_fake(false);
- set_invisible(false);
- set_away(false, "");
- set_sock(NULL);
+ set_fake( false );
+ set_invisible( false );
+ set_away( false, "" );
}
void
@@ -89,8 +121,8 @@ user::destroy_session()
#ifdef DATABASE
// Store all changed data into the mysql table if this user is registered:
if ( b_is_reg )
- wrap::DATA->update_user_data( get_name(), "savechangednick",
- map_changed_data );
+ wrap::DATA->update_user_data( get_name(), "savechangednick",
+ map_changed_data );
#endif
set_has_sess(false);
@@ -115,46 +147,78 @@ user::get_data( map<string,string> *p_map_data )
(*p_map_data)[get_name()] = get_col1();
}
+string
+user::get_mess( )
+{
+ pthread_mutex_lock ( &mut_s_mess );
+ string s_ret = s_mess;
+ s_mess = "";
+ pthread_mutex_unlock( &mut_s_mess );
+ return s_ret;
+}
+
bool
user::get_online( )
{
- return b_online;
+ bool b_ret;
+ pthread_mutex_lock ( &mut_b_online );
+ b_ret = b_online;
+ pthread_mutex_unlock( &mut_b_online );
+ return b_ret;
}
-
bool
user::get_fake( )
{
- return b_fake;
+ bool b_ret;
+ pthread_mutex_lock ( &mut_b_fake );
+ b_ret = b_fake;
+ pthread_mutex_unlock( &mut_b_fake );
+ return b_ret;
}
-
bool
user::get_invisible( )
{
- return b_invisible;
+ bool b_ret;
+ pthread_mutex_lock ( &mut_b_invisible );
+ b_ret = b_invisible;
+ pthread_mutex_unlock( &mut_b_invisible );
+ return b_ret;
}
bool
user::get_has_sess( )
{
- return b_has_sess;
+ bool b_ret;
+ pthread_mutex_lock ( &mut_b_has_sess );
+ b_ret = b_has_sess;
+ pthread_mutex_unlock( &mut_b_has_sess );
+ return b_ret;
}
void
-user::set_has_sess(bool b_has_sess)
+user::set_has_sess( bool b_has_sess )
{
+ pthread_mutex_lock ( &mut_b_has_sess );
this->b_has_sess = b_has_sess;
+ pthread_mutex_unlock( &mut_b_has_sess );
}
bool
user::get_is_reg( )
{
- return b_is_reg;
+ bool b_ret;
+ b_ret = b_is_reg;
+ return b_ret;
}
bool
user::get_is_gag( )
{
- return b_is_gag;
+ bool b_ret;
+ pthread_mutex_lock ( &mut_b_is_gag );
+ b_ret = b_is_gag;
+ pthread_mutex_unlock( &mut_b_is_gag );
+ return b_ret;
}
void
@@ -166,60 +230,42 @@ user::set_is_reg( bool b_is_reg )
void
user::set_is_gag( bool b_is_gag )
{
+ pthread_mutex_lock ( &mut_b_is_gag );
this -> b_is_gag = b_is_gag;
+ pthread_mutex_unlock( &mut_b_is_gag );
}
void
user::set_online( bool b_online )
{
- if (this->b_online == b_online)
- return;
-
+ pthread_mutex_lock ( &mut_b_online );
this -> b_online = b_online;
- if (!b_online)
- {
- cout << "SETTING OFFLINE" << endl;
- // remove the user from its room.
- string s_user(get_name());
- string s_user_lowercase(get_lowercase_name());
-
- room* p_room = get_room();
- p_room->del_elem(s_user_lowercase);
-
- // post the room that the user has left the chat.
- string s_msg = wrap::TIMR->get_time() + " "
- + get_colored_bold_name()
- + wrap::CONF->get_elem( "chat.msgs.userleaveschat" )
- + "<br>\n";
-
- p_room->msg_post( &s_msg );
- p_room->reload_onlineframe();
-
-#ifdef VERBOSE
- cout << REMUSER << s_user << endl;
-#endif
-
- wrap::GCOL->add_user_to_garbage(this);
- }
+ pthread_mutex_unlock( &mut_b_online );
}
void
user::set_fake( bool b_fake )
{
+ pthread_mutex_lock ( &mut_b_fake );
this -> b_fake = b_fake;
+ pthread_mutex_unlock( &mut_b_fake );
}
void
user::set_invisible( bool b_invisible )
{
+ pthread_mutex_lock ( &mut_b_invisible );
this -> b_invisible = b_invisible;
+ pthread_mutex_unlock( &mut_b_invisible );
}
bool
user::get_away()
{
bool b_ret;
+ pthread_mutex_lock ( &mut_away );
b_ret = b_away;
+ pthread_mutex_unlock( &mut_away );
return b_ret;
}
@@ -227,35 +273,45 @@ string
user::get_away_msg()
{
string s_ret;
+ pthread_mutex_lock ( &mut_away );
s_ret = s_away;
+ pthread_mutex_unlock( &mut_away );
return s_ret;
}
void
user::set_away( bool b_away, string s_away )
{
+ pthread_mutex_lock ( &mut_away );
this -> b_away = b_away;
this -> s_away = s_away;
+ pthread_mutex_unlock( &mut_away );
}
void
user::set_away( bool b_away )
{
+ pthread_mutex_lock ( &mut_away );
this -> b_away = b_away;
+ pthread_mutex_unlock( &mut_away );
}
room*
user::get_room( )
{
room* p_return;
+ pthread_mutex_lock ( &mut_p_room );
p_return = p_room;
+ pthread_mutex_unlock( &mut_p_room );
return p_return;
}
void
user::set_p_room( room* p_room )
{
+ pthread_mutex_lock ( &mut_p_room );
this -> p_room = p_room;
+ pthread_mutex_unlock( &mut_p_room );
}
/*
@@ -270,7 +326,9 @@ string
user::get_pass()
{
string s_ret;
+ pthread_mutex_lock ( &mut_s_pass );
s_ret = s_pass;
+ pthread_mutex_unlock( &mut_s_pass );
return s_ret;
}
@@ -278,7 +336,9 @@ string
user::get_col1()
{
string s_ret;
+ pthread_mutex_lock ( &mut_s_col1 );
s_ret = s_col1;
+ pthread_mutex_unlock( &mut_s_col1 );
return s_ret;
}
@@ -286,7 +346,9 @@ string
user::get_col2()
{
string s_ret;
+ pthread_mutex_lock ( &mut_s_col2 );
s_ret = s_col2;
+ pthread_mutex_unlock( &mut_s_col2 );
return s_ret;
}
@@ -294,7 +356,9 @@ string
user::get_email()
{
string s_ret;
+ pthread_mutex_lock ( &mut_s_email );
s_ret = s_email;
+ pthread_mutex_unlock( &mut_s_email );
return s_ret;
}
@@ -302,49 +366,63 @@ string
user::get_tmpid()
{
string s_ret;
+ pthread_mutex_lock ( &mut_s_tmpid );
s_ret = s_tmpid;
+ pthread_mutex_unlock( &mut_s_tmpid );
return s_ret;
}
void
user::set_tmpid ( string s_tmpid )
{
+ pthread_mutex_lock ( &mut_s_tmpid );
this -> s_tmpid = s_tmpid;
+ pthread_mutex_unlock( &mut_s_tmpid );
}
void
user::set_pass ( string s_pass )
{
set_changed_data( "password", s_pass );
+ pthread_mutex_lock ( &mut_s_pass );
this -> s_pass = s_pass;
+ pthread_mutex_unlock( &mut_s_pass );
}
void
user::set_col1 ( string s_col1 )
{
set_changed_data( "color1", s_col1 );
+ pthread_mutex_lock ( &mut_s_col1 );
this -> s_col1 = s_col1;
+ pthread_mutex_unlock( &mut_s_col1 );
}
void
user::set_col2 ( string s_col2 )
{
set_changed_data( "color2", s_col2 );
+ pthread_mutex_lock ( &mut_s_col2 );
this -> s_col2 = s_col2;
+ pthread_mutex_unlock( &mut_s_col2 );
}
void
user::set_email ( string s_email )
{
set_changed_data( "email", s_email );
+ pthread_mutex_lock ( &mut_s_email );
this -> s_email = s_email;
+ pthread_mutex_unlock( &mut_s_email );
}
int
user::get_status ( )
{
int r_ret;
+ pthread_mutex_lock ( &mut_i_status );
r_ret = i_status;
+ pthread_mutex_unlock(&mut_i_status );
return r_ret;
}
@@ -352,8 +430,10 @@ void
user::set_status ( int i_status )
{
set_changed_data( "status", tool::int2string(i_status));
+ pthread_mutex_lock ( &mut_i_status );
i_old_status = this -> i_status;
this -> i_status = i_status;
+ pthread_mutex_unlock( &mut_i_status );
}
void
@@ -361,18 +441,28 @@ user::set_changed_data( string s_varname, string s_value )
{
if ( b_set_changed_data )
{
+ pthread_mutex_lock ( &mut_map_changed_data );
map_changed_data[s_varname] = s_value;
+ pthread_mutex_unlock( &mut_map_changed_data );
}
}
+bool
+user::new_msgs ( )
+{
+ pthread_mutex_lock ( &mut_s_mess );
+ return s_mess.empty();
+ pthread_mutex_unlock( &mut_s_mess );
+}
+
void
user::command( string &s_command )
{
check_restore_away();
- unsigned long pos = s_command.find( "/" );
- unsigned long pos2 = s_command.find( " " );
- if ( pos != (unsigned long) string::npos )
+ unsigned pos = s_command.find( "/" );
+ unsigned pos2 = s_command.find( " " );
+ if( pos != string::npos )
{
s_command.replace( pos, 1, "" );
}
@@ -434,88 +524,57 @@ user::command( string &s_command )
delete c;
}
+
void
-user::set_sock(_socket* p_sock)
+user::s_mess_delete( )
{
- this->p_sock = p_sock;
+ pthread_mutex_lock ( &mut_s_mess );
+ s_mess = "";
+ pthread_mutex_unlock( &mut_s_mess );
}
+
void
user::msg_post( string *p_msg )
{
- /*
- ++l_messages_recv;
- if (p_sock == NULL) {
- s_msg.append(*p_msg);
- return;
-
- }
- else if (!s_msg.empty())
- {
- wrap::SOCK->_send(p_sock, s_msg.c_str(), s_msg.size() );
- s_msg.clear();
- }
+ pthread_mutex_lock ( &mut_s_mess );
+ s_mess.append( *p_msg );
+ pthread_mutex_unlock( &mut_s_mess );
- if ( 0 > wrap::SOCK->_send(p_sock, p_msg->c_str(), p_msg->size() ) ) {
- cout << "psock: " << (int) p_sock << endl;
- set_online( false );
- */
+ pthread_cond_signal( &cond_message );
}
-/*
- void
- sock::handle_client_write(int i_fd, short event, void *p_arg) {
- static int i_char_size = sizeof(char);
-
- context *p_context = static_cast<context*>(p_arg);
- string *p_response = p_context->p_response;
-
- if (-1 == write(i_fd, p_response->c_str(), p_response->length()*i_char_size))
- {
- switch (errno) {
- case EAGAIN:
- case EINTR:
- event_add(p_context->p_event, NULL);
- return;
- }
- }
-
- delete p_context;
- }
-*/
void
user::post_action_msg(string s_msgkey)
{
- get_room()->msg_post(wrap::TIMR->get_time()+" "+get_colored_bold_name()+wrap::CONF->get_elem(s_msgkey)+"<br>\n");
+ get_room()->msg_post(wrap::TIMR->get_time()+" "+get_colored_bold_name()+wrap::CONF->get_elem(s_msgkey)+"<br>\n");
}
void
-user::renew_timeout()
+user::renew_timeout()
{
timo::renew_timeout();
double d_time_diff = wrap::TIMR->get_time_diff(t_flood_time);
- if (d_time_diff < static_cast<double>(wrap::CONF->get_int("chat.floodprotection.seconds"))
- )
+ if (d_time_diff < static_cast<double>(wrap::CONF->get_int("chat.floodprotection.seconds")))
{
- if (++i_flood_messages > static_cast<double>(wrap::CONF->get_int("chat.floodprotection.messages"))
- )
- {
- room* p_room = get_room();
- if (p_room == 0)
- {
- i_flood_messages = 0;
- return;
- }
-
- wrap::system_message(CHATFLO+get_name()+","+p_room->get_name()+","+tool::int2string(i_flood_messages)+")");
- msg_post(wrap::CONF->colored_error_msg("chat.msgs.err.flooding"));
- if (!get_is_gag())
- {
- set_is_gag(true);
- post_action_msg("chat.msgs.floodgag");
- }
- }
+ if (++i_flood_messages > static_cast<double>(wrap::CONF->get_int("chat.floodprotection.messages")))
+ {
+ room* p_room = get_room();
+ if (p_room == 0)
+ {
+ i_flood_messages = 0;
+ return;
+ }
+
+ wrap::system_message(CHATFLO+get_name()+","+p_room->get_name()+","+tool::int2string(i_flood_messages)+")");
+ msg_post(wrap::CONF->colored_error_msg("chat.msgs.err.flooding"));
+ if (!get_is_gag())
+ {
+ set_is_gag(true);
+ post_action_msg("chat.msgs.floodgag");
+ }
+ }
}
else
@@ -523,7 +582,7 @@ user::renew_timeout()
time(&t_flood_time);
i_flood_messages = 0;
}
-}
+}
void
user::check_timeout( int* i_idle_timeout )
@@ -538,6 +597,7 @@ user::check_timeout( int* i_idle_timeout )
msg_post( &s_quit );
set_online( false );
+ pthread_cond_signal( &cond_message );
}
else if ( ! get_away() && i_idle_timeout[2] <= d_user_timeout )
{
@@ -624,21 +684,18 @@ user::reconf()
void
user::dumpit()
{
- dumpable::add
- ("[user]");
- dumpable::add
- ("Name: " + get_name() +
- "; Room: " + get_room()->get_name() +
- "; Status: " + tool::int2string(get_status()));
- dumpable::add
- ("TempID: " + get_tmpid());
+ dumpable::add("[user]");
+ dumpable::add("Name: " + get_name() +
+ "; Room: " + get_room()->get_name() +
+ "; Status: " + tool::int2string(get_status()));
+ dumpable::add("TempID: " + get_tmpid());
}
bool
user::same_rooms(user *p_user)
{
return p_user->get_room()->get_lowercase_name()
- .compare(this->get_room()->get_lowercase_name()) == 0;
+ .compare(this->get_room()->get_lowercase_name()) == 0;
}
string
diff --git a/src/chat/user.h b/src/chat/user.h
index 1369067..cde0729 100644
--- a/src/chat/user.h
+++ b/src/chat/user.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/chat/user.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -47,8 +46,8 @@ class user :
private:
// private members:
- _socket *p_sock;
- string s_msg;
+ string s_mess; // message string which has to be sent to the user.
+
bool b_online; // true if user is online.
bool b_has_sess; // true if user already has a session!
bool b_is_reg; // true if user is registered
@@ -61,8 +60,7 @@ private:
int i_status; // user's rang ( see enum rang @ globals.h ).
int i_old_status; // user's previous status.
int i_flood_messages; // user's message posts (needed for flood protection, does not need to be syncronized)
- time_t t_flood_time; // user's time count (needed for flood protection, does not need to be syncronized)
- long l_messages_recv;
+ time_t t_flood_time; // user's time count (needed for flood protection, does not need to be syncronized)
string s_tmpid;
string s_agnt; // user's http user agent.
@@ -72,14 +70,36 @@ private:
string s_email; // user's email addres
string s_pass; // password
room* p_room; // pointer to the user's room.
+// sess** p_sess; // pointer to the pointer to the session object
hashmap<string> map_changed_data; // Needed to tell yChat which data to change after user is removed!
+ pthread_mutex_t mut_map_changed_data;
+ pthread_mutex_t mut_s_mess;
+
+ // Modules which are allowed to be executed by the user.
+
+ pthread_mutex_t mut_away;
+ pthread_mutex_t mut_b_online;
+ pthread_mutex_t mut_b_fake;
+ pthread_mutex_t mut_b_invisible;
+ pthread_mutex_t mut_b_has_sess;
+ pthread_mutex_t mut_b_is_reg;
+ pthread_mutex_t mut_b_is_gag;
+ pthread_mutex_t mut_s_pass;
+ pthread_mutex_t mut_p_room;
+ pthread_mutex_t mut_s_col1;
+ pthread_mutex_t mut_s_col2;
+ pthread_mutex_t mut_s_email;
+ pthread_mutex_t mut_s_tmpid;
+ pthread_mutex_t mut_i_status;
void initialize();
void set_changed_data( string s_varname, string s_value );
void dumpit();
public:
+ pthread_cond_t cond_message;
+ pthread_mutex_t mut_message;
user();
user(string s_name);
@@ -99,63 +119,58 @@ public:
{
return "<b>" + get_colored_name() + "</b>";
}
- void msg_clear()
- {
- s_msg.clear();
- }
- bool get_online();
- bool get_fake();
- bool get_invisible();
- bool get_has_sess();
- bool get_is_reg();
- bool get_is_gag();
- void set_online( bool b_online );
- void set_sock(_socket *p_sock);
- void set_fake( bool b_fake );
- void set_invisible( bool b_invisible );
- void set_has_sess( bool b_has_sess );
- void set_is_reg( bool b_is_reg );
- void set_is_gag( bool b_is_gag );
- void set_changed_data_on()
- {
- b_set_changed_data = 1;
- }
- bool get_away( );
- string get_away_msg( );
- void set_away( bool b_away, string s_away );
- void set_away( bool b_away );
+ bool get_online();
+ bool get_fake();
+ bool get_invisible();
+ bool get_has_sess();
+ bool get_is_reg();
+ bool get_is_gag();
+ void set_online( bool b_online );
+ void set_fake( bool b_fake );
+ void set_invisible( bool b_invisible );
+ void set_has_sess( bool b_has_sess );
+ void set_is_reg( bool b_is_reg );
+ void set_is_gag( bool b_is_gag );
+ void set_changed_data_on() { b_set_changed_data = 1; }
+ bool get_away( );
+ string get_away_msg( );
+ void set_away( bool b_away, string s_away );
+ void set_away( bool b_away );
room* get_room();
- void set_p_room( room* p_room );
- // void set_sess(sess** p_sess);
+ void set_p_room( room* p_room );
+// void set_sess(sess** p_sess);
string get_pass();
string get_col1();
string get_col2();
string get_email();
string get_tmpid();
- void set_tmpid( string s_tmpid );
- void set_pass( string s_col1 );
- void set_col1( string s_col1 );
- void set_col2( string s_col2 );
- void set_email( string s_email );
- int get_status( );
- void set_status( int i_status );
- void set_messages_recv( long l )
- {
- l_messages_recv = l;
- }
- void post_action_msg(string s_msgkey);
- void check_timeout( int* i_idle_timeout );
- void renew_timeout();
+ void set_tmpid( string s_tmpid );
+ void set_pass( string s_col1 );
+ void set_col1( string s_col1 );
+ void set_col2( string s_col2 );
+ void set_email( string s_email );
+ int get_status( );
+ void set_status( int i_status );
+ bool new_msgs ( );
+ void post_action_msg(string s_msgkey);
+ void check_timeout( int* i_idle_timeout );
+ void renew_timeout();
// executes a command.
void command( string &s_command );
+ // gets the message and clears s_mess;
+ string get_mess();
+
+ // Here are starting methods which are mainly needed by the data<type> class.
+ // appends a string to s_mess including br.
void msg_post( string s_msg )
{
msg_post( &s_msg );
}
void msg_post( string *p_msg );
+ void s_mess_delete( );
void get_user_list( string &s_list );
void check_restore_away();
void reconf();