soc.2009.transport: 6d9aa9c6: Turn off notify_email by default and fix...
hanzz at soc.pidgin.im
hanzz at soc.pidgin.im
Thu Jun 18 15:15:22 EDT 2009
-----------------------------------------------------------------
Revision: 6d9aa9c60970ec5f26b9ba4caae37b6fc496de97
Ancestor: 0e4ae8f6f5a00a53a40430b6b3193cf277c76eb5
Author: hanzz at soc.pidgin.im
Date: 2009-06-18T19:10:53
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/6d9aa9c60970ec5f26b9ba4caae37b6fc496de97
Modified files:
adhocrepeater.cpp adhocsettings.cpp main.cpp main.h user.cpp
ChangeLog:
Turn off notify_email by default and fix complete and cancel IQ for Adhoc
-------------- next part --------------
============================================================
--- adhocrepeater.cpp 2d2e1a37ac9e0f387ef7c751c2aea2581bc8699c
+++ adhocrepeater.cpp de702e24353f8b93dc682cdbfd08817721c072d5
@@ -156,6 +156,7 @@ bool AdhocRepeater::handleIq(const IQ &s
c->addAttribute("sessionid",tag->findAttribute("sessionid"));
c->addAttribute("node","configuration");
c->addAttribute("status","canceled");
+ response->addChild(c);
main->j->send(response);
g_timeout_add(0,&removeRepeater,this);
@@ -196,6 +197,7 @@ bool AdhocRepeater::handleIq(const IQ &s
c->addAttribute("sessionid",tag->findAttribute("sessionid"));
c->addAttribute("node","configuration");
c->addAttribute("status","completed");
+ s->addChild(c);
main->j->send(s);
g_timeout_add(0,&removeRepeater,this);
============================================================
--- adhocsettings.cpp 37b19843f9d703aee2c53c09f479dae131aef887
+++ adhocsettings.cpp fa29a91eabf7daf6c0a2dd5a9b55c1c1bdc12e84
@@ -114,6 +114,7 @@ bool AdhocSettings::handleIq(const IQ &s
c->addAttribute("sessionid",tag->findAttribute("sessionid"));
c->addAttribute("node","configuration");
c->addAttribute("status","canceled");
+ response->addChild(c);
main->j->send(response);
// g_timeout_add(0,&removeHandler,this);
@@ -155,6 +156,7 @@ bool AdhocSettings::handleIq(const IQ &s
c->addAttribute("sessionid",tag->findAttribute("sessionid"));
c->addAttribute("node","configuration");
c->addAttribute("status","completed");
+ s->addChild(c);
main->j->send(s);
// g_timeout_add(0,&removeRepeater,this);
============================================================
--- main.cpp 463a0ae038c034783d817085add45adc91c7fd6d
+++ main.cpp f635734d9c5f0ff1e25f5726624c25b62687be23
@@ -829,6 +829,13 @@ void GlooxMessageHandler::loadConfigFile
m_configuration.bindIPs[i] = (std::string)bind[i];
}
g_strfreev (bind);
+
+ bind = g_key_file_get_string_list(keyfile, "service", "allowed_servers", NULL, NULL);
+ for (i = 0; bind[i]; i++){
+ m_configuration.allowedServers.push_back((std::string) bind[i]);
+ }
+ g_strfreev (bind);
+
g_key_file_free(keyfile);
}
@@ -1139,7 +1146,7 @@ void GlooxMessageHandler::handlePresence
}
else {
bool isVip = sql()->isVIP(stanza.from().bare());
- if (configuration().onlyForVIP && !isVip){
+ if (configuration().onlyForVIP && !isVip && std::find(configuration().allowedServers.begin(), configuration().allowedServers.end(), stanza.from().server()) == configuration().allowedServers.end()){
Log().Get(stanza.from().full()) << "This user is not VIP, can't login...";
return;
}
============================================================
--- main.h b98de4bc7f20a8b7351934aca86892150f5c4adf
+++ main.h 06703d8d35afa8ea569f5a2f5211523ef531138b
@@ -131,6 +131,7 @@ struct Configuration {
int port; // server port
bool onlyForVIP; // true if transport is only for users in VIP users database
+ std::list <std::string> allowedServers;
std::map<int,std::string> bindIPs; // IP address to which libpurple should bind connections
std::string userDir; // directory used as .tmp directory for avatars and other libpurple stuff
============================================================
--- user.cpp f83573d241a936d4a618ab64a269ca12abd6d481
+++ user.cpp 6b8ddcb9173a57bc2171b6c789f993e99f1447a4
@@ -66,10 +66,10 @@ User::User(GlooxMessageHandler *parent,
g_hash_table_replace(m_settings, g_strdup("enable_transport"), value);
}
if ( (value = getSetting("enable_notify_email")) == NULL ) {
- p->sql()->addSetting(m_jid, "enable_notify_email", "1", PURPLE_TYPE_BOOLEAN);
+ p->sql()->addSetting(m_jid, "enable_notify_email", "0", PURPLE_TYPE_BOOLEAN);
value = purple_value_new(PURPLE_TYPE_BOOLEAN);
- purple_value_set_boolean(value, true);
- g_hash_table_replace(m_settings, g_strdup("enable_transport"), value);
+ purple_value_set_boolean(value, false);
+ g_hash_table_replace(m_settings, g_strdup("enable_notify_email"), value);
}
if ( (value = getSetting("enable_avatars")) == NULL ) {
p->sql()->addSetting(m_jid, "enable_avatars", "1", PURPLE_TYPE_BOOLEAN);
More information about the Commits
mailing list