+ },
+
+ StatusNetInstance: {
+ Set: function(value) {
+ var SNI = SN.U.StatusNetInstance.Get();
+ if (SNI !== null) {
+ value = $.extend(SNI, value);
+ }
+
+ $.cookie(
+ SN.C.S.StatusNetInstance,
+ JSON.stringify(value),
+ {
+ path: '/',
+ expires: SN.U.GetFullYear(2029, 0, 1)
+ });
+ },
+
+ Get: function() {
+ var cookieValue = $.cookie(SN.C.S.StatusNetInstance);
+ if (cookieValue !== null) {
+ return JSON.parse(cookieValue);
+ }
+ return null;
+ },
+
+ Delete: function() {
+ $.cookie(SN.C.S.StatusNetInstance, null);
+ }
+ },
+
+ /**
+ * Check if the current page is a timeline where the current user's
+ * posts should be displayed immediately on success.
+ *
+ * @fixme this should be done in a saner way, with machine-readable
+ * info about what page we're looking at.
+ */
+ belongsOnTimeline: function(notice) {
+ var action = $("body").attr('id');
+ if (action == 'public') {
+ return true;
+ }
+
+ var profileLink = $('#nav_profile a').attr('href');
+ if (profileLink) {
+ var authorUrl = $(notice).find('.entry-title .author a.url').attr('href');
+ if (authorUrl == profileLink) {
+ if (action == 'all' || action == 'showstream') {
+ // Posts always show on your own friends and profile streams.
+ return true;
+ }
+ }
+ }
+
+ // @fixme tag, group, reply timelines should be feasible as well.
+ // Mismatch between id-based and name-based user/group links currently complicates
+ // the lookup, since all our inline mentions contain the absolute links but the
+ // UI links currently on the page use malleable names.
+
+ return false;