Added opensteamworks via libpurple (#203)

* add compatibility for steam guard in opensteamworks plugin, fixes #62 


* steam guard changes
This commit is contained in:
Florian Kinder 2017-06-05 11:27:27 +02:00 committed by vitalyster
parent 41b9b56406
commit 6872e99abb
2 changed files with 62 additions and 40 deletions

View file

@ -6,7 +6,7 @@ ARG commit=unknown
RUN echo $commit RUN echo $commit
# Spectrum 2 # Spectrum 2
RUN dnf install protobuf protobuf swiften gcc gcc-c++ make libpqxx-devel libpurple-devel protobuf-devel swiften-devel rpm-build avahi-devel boost-devel cmake cppunit-devel expat-devel libcommuni-devel libidn-devel libsqlite3x-devel log4cxx-devel gettext libgcrypt-devel libwebp-devel libpurple-devel zlib-devel json-glib-devel python-pip zlib-devel libjpeg-devel python-devel mysql-devel popt-devel git libevent-devel qt-devel dbus-glib-devel libcurl-devel wget mercurial libtool -y && \ RUN dnf install protobuf protobuf swiften gcc gcc-c++ make libpqxx-devel libpurple-devel protobuf-devel swiften-devel rpm-build avahi-devel boost-devel cmake cppunit-devel expat-devel libcommuni-devel libidn-devel libsqlite3x-devel log4cxx-devel gettext libgcrypt-devel libwebp-devel libpurple-devel zlib-devel json-glib-devel python-pip zlib-devel libjpeg-devel python-devel mysql-devel popt-devel git libevent-devel qt-devel dbus-glib-devel libcurl-devel wget mercurial libtool libgnome-keyring-devel nss-devel -y && \
echo "---> Installing Spectrum 2" && \ echo "---> Installing Spectrum 2" && \
git clone git://github.com/hanzz/spectrum2.git && \ git clone git://github.com/hanzz/spectrum2.git && \
cd spectrum2 && \ cd spectrum2 && \
@ -62,6 +62,13 @@ RUN dnf install protobuf protobuf swiften gcc gcc-c++ make libpqxx-devel libpurp
make install && \ make install && \
cd .. && \ cd .. && \
rm -rf purple-discord && \ rm -rf purple-discord && \
echo "---> Install Steam" && \
git clone https://github.com/EionRobb/pidgin-opensteamworks.git && \
cd pidgin-opensteamworks/steam-mobile && \
make && \
make install && \
cd ../.. && \
rm -rf pidgin-opensteamworks && \
echo "---> cleanup" && \ echo "---> cleanup" && \
rm -rf /usr/share/locale/* && \ rm -rf /usr/share/locale/* && \
rm -rf /usr/share/doc/* && \ rm -rf /usr/share/doc/* && \

View file

@ -369,6 +369,10 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
adminLegacyName = "hangouts"; adminLegacyName = "hangouts";
adminAlias = "hangouts"; adminAlias = "hangouts";
} }
else if (protocol == "prpl-steam-mobile") {
adminLegacyName = "steam-mobile";
adminAlias = "steam-mobile";
}
if (!purple_find_prpl_wrapped(protocol.c_str())) { if (!purple_find_prpl_wrapped(protocol.c_str())) {
LOG4CXX_INFO(logger, name.c_str() << ": Invalid protocol '" << protocol << "'"); LOG4CXX_INFO(logger, name.c_str() << ": Invalid protocol '" << protocol << "'");
@ -1614,6 +1618,17 @@ void * requestInput(const char *title, const char *primary,const char *secondary
np->m_inputRequests[req->mainJID] = req; np->m_inputRequests[req->mainJID] = req;
return NULL; return NULL;
} }
else if (primaryString == "Set your Steam Guard Code") {
LOG4CXX_INFO(logger, "prpl-steam-mobile steam guard request");
np->handleMessage(np->m_accounts[account], np->adminLegacyName, std::string("Steam Guard code: "));
inputRequest *req = new inputRequest;
req->ok_cb = (PurpleRequestInputCb)ok_cb;
req->user_data = user_data;
req->account = account;
req->mainJID = np->m_accounts[account];
np->m_inputRequests[req->mainJID] = req;
return NULL;
}
else { else {
LOG4CXX_WARN(logger, "Unhandled request input. primary=" << primaryString); LOG4CXX_WARN(logger, "Unhandled request input. primary=" << primaryString);
} }