summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-06-28 13:49:03 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-06-28 13:49:03 -0700
commitefbe197028473a39ea3aab16829462d585d44fb2 (patch)
tree7ae457b9d02f935732100b3bf53e96706c1085f0
parentdb5aba55b1d51f083dd61781c32c57c0b986909a (diff)
parent89ae19e57edc9abfd300b17caf2719d7794dabf9 (diff)
merge
-rw-r--r--indra/newview/llfacebookconnect.cpp29
-rw-r--r--indra/newview/llfloatersocial.cpp2
-rwxr-xr-xindra/newview/llviewermenu.cpp60
-rwxr-xr-xindra/newview/llviewermenu.h9
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_viewer.xml20
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml32
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_snapshot_facebook.xml4
7 files changed, 11 insertions, 145 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 52268daa36..dc450aab7a 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -41,19 +41,12 @@
// Local functions
-void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description)
+void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description)
{
- // Note: 302 (redirect) is *not* an error that warrants prompting the user
+ // Note: 302 (redirect) is *not* an error that warrants logging
if (status != 302)
{
- LLSD args(LLSD::emptyMap());
- std::stringstream msg;
- msg << status;
- args["STATUS"] = msg.str();
- args["REASON"] = reason;
- args["CODE"] = code;
- args["DESCRIPTION"] = description;
- LLNotificationsUtil::add("FacebookCannotConnect", args);
+ LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << "(" << description << ")" << LL_ENDL;
}
}
@@ -113,8 +106,7 @@ public:
else
{
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
- prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
- LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+ log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description"));
}
}
@@ -147,8 +139,7 @@ public:
}
else
{
- prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
- LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
+ log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description"));
}
if (mShareCallback)
@@ -188,8 +179,7 @@ public:
}
else
{
- prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
- LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+ log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description"));
}
}
};
@@ -218,8 +208,6 @@ public:
}
else
{
- LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
-
// show the facebook login page if not connected yet
if (status == 404)
{
@@ -235,7 +223,7 @@ public:
else
{
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
- prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
+ log_facebook_connect_error("Connected", status, reason, content.get("error_code"), content.get("error_description"));
}
}
}
@@ -261,8 +249,7 @@ public:
}
else
{
- prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description"));
- LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+ log_facebook_connect_error("Friends", status, reason, content.get("error_code"), content.get("error_description"));
}
}
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index dfc9024d54..d6c00b7c86 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -128,7 +128,7 @@ mCaptionTextBox(NULL),
mLocationCheckbox(NULL),
mPostButton(NULL)
{
- mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this));
+ mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this));
}
LLSocialPhotoPanel::~LLSocialPhotoPanel()
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 47787e2687..137eeb6a99 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5953,56 +5953,6 @@ void handle_report_abuse()
LLFloaterReporter::showFromMenu(COMPLAINT_REPORT);
}
-void handle_facebook_connect()
-{
- if (!LLFacebookConnect::instance().isConnected())
- {
- LLFacebookConnect::instance().getConnectionToFacebook(true);
- }
-}
-
-bool enable_facebook_connect()
-{
- // The menu item will be disabled if we are already connected
- return !LLFacebookConnect::instance().isConnected();
-}
-
-void handle_facebook_checkin()
-{
-
- // Get the location SLURL
- LLSLURL slurl;
- LLAgentUI::buildSLURL(slurl);
- std::string slurl_string = slurl.getSLURLString();
-
- std::string region_name = gAgent.getRegion()->getName();
- std::string description;
- LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent());
- LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal();
- int x_pos = center_agent[0] / 256.0;
- int y_pos = center_agent[1] / 256.0;
- std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos);
-
- LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, "");
-}
-
-bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if (option == 0)
- {
- std::string message = response["message"].asString();
- if (!message.empty())
- LLFacebookConnect::instance().updateStatus(message);
- }
- return false;
-}
-
-void handle_facebook_status()
-{
- LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2));
-}
-
void handle_buy_currency()
{
LLBuyCurrencyHTML::openCurrencyFloater();
@@ -8801,14 +8751,4 @@ void initialize_menus()
view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected");
view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
-
- // Facebook Connect
- commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect));
- enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect));
-
- // Facebook Checkin
- commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin));
-
- // Facebook Status Update
- commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status));
}
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index e71beef10d..143420e227 100755
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -135,15 +135,6 @@ bool enable_pay_object();
bool enable_buy_object();
bool handle_go_to();
-// Facebook Connect
-void handle_facebook_connect();
-
-// Facebook Checkin
-void handle_facebook_checkin();
-
-// Facebook Status Update
-void handle_facebook_status();
-
// Export to XML or Collada
void handle_export_selected( void * );
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 733eb16c54..6da4b3d234 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -16,26 +16,6 @@
parameter="agent" />
</menu_item_call>
<menu_item_call
- label="Connect to Facebook..."
- name="ConnectToFacebook">
- <menu_item_call.on_click
- function="Facebook.Connect" />
- <menu_item_call.on_enable
- function="Facebook.EnableConnect" />
- </menu_item_call>
- <menu_item_call
- label="Check in to Facebook..."
- name="CheckinToFacebook">
- <menu_item_call.on_click
- function="Facebook.Checkin" />
- </menu_item_call>
- <menu_item_call
- label="Update status on Facebook..."
- name="UpdateStatusOnFacebook">
- <menu_item_call.on_click
- function="Facebook.UpdateStatus" />
- </menu_item_call>
- <menu_item_call
label="Post to Facebook..."
name="PostToFacebook">
<menu_item_call.on_click
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 5f4869e110..1f20d3ab58 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5442,17 +5442,6 @@ Sorry, the settings couldn't be applied to the region. Leaving the region and t
<notification
functor="GenericAcknowledge"
icon="alertmodal.tga"
- name="FacebookCannotConnect"
- type="alertmodal">
-Connection to Facebook failed. Reason: [STATUS] [REASON] ([CODE] - [DESCRIPTION])
- <usetemplate
- name="okbutton"
- yestext="OK"/>
- </notification>
-
- <notification
- functor="GenericAcknowledge"
- icon="alertmodal.tga"
name="EnvCannotDeleteLastDayCycleKey"
type="alertmodal">
Unable to delete the last key in this day cycle because you cannot have an empty day cycle. You should modify the last remaining key instead of attempting to delete it and then to create a new one.
@@ -10135,25 +10124,4 @@ Cannot create large prims that intersect other players. Please re-try when othe
yestext="OK"/>
</notification>
- <notification
- icon="alertmodal.tga"
- name="FacebookUpdateStatus"
- type="alertmodal">
- What's on your mind? (asks Facebook)
- <tag>confirm</tag>
- <form name="form">
- <input name="message" type="text">
- </input>
- <button
- default="true"
- index="0"
- name="OK"
- text="OK"/>
- <button
- index="1"
- name="Cancel"
- text="Cancel"/>
- </form>
- </notification>
-
</notifications>
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml b/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
index 2810f97ca6..7a89ed69b5 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml
@@ -182,7 +182,7 @@
top="350"
width="100">
<button.commit_callback
- function="PostToFacebook.Cancel" />
+ function="SocialSharing.Cancel" />
</button>
<button
follows="right|bottom"
@@ -194,6 +194,6 @@
top_delta="0"
width="100">
<button.commit_callback
- function="PostToFacebook.Send" />
+ function="SocialSharing.SendPhoto" />
</button>
</panel>