Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2013
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.30 KB | None | 0 0
  1. /*1372893329,178134621*/
  2.  
  3. if (self.CavalryLogger) { CavalryLogger.start_js(["mzYD3"]); }
  4.  
  5. __d("MercuryAPIArgsSource",[],function(a,b,c,d,e,f){e.exports={JEWEL:"jewel",CHAT:"chat",MERCURY:"mercury",WEBMESSENGER:"web_messenger"};});
  6. __d("MercuryActionStatus",[],function(a,b,c,d,e,f){e.exports={UNCONFIRMED:3,UNSENT:0,RESENDING:7,RESENT:6,UNABLE_TO_CONFIRM:5,FAILED_UNKNOWN_REASON:4,SUCCESS:1,ERROR:10};});
  7. __d("MercuryActionTypeConstants",[],function(a,b,c,d,e,f){e.exports={LOG_MESSAGE:"ma-type:log-message",CLEAR_CHAT:"ma-type:clear_chat",UPDATE_ACTION_ID:"ma-type:update-action-id",DELETE_MESSAGES:"ma-type:delete-messages",CHANGE_FOLDER:"ma-type:change-folder",SEND_MESSAGE:"ma-type:send-message",CHANGE_ARCHIVED_STATUS:"ma-type:change-archived-status",DELETE_THREAD:"ma-type:delete-thread",USER_GENERATED_MESSAGE:"ma-type:user-generated-message",CHANGE_READ_STATUS:"ma-type:change_read_status",CHANGE_MUTE_SETTINGS:"ma-type:change-mute-settings"};});
  8. __d("MercuryAttachmentContentType",[],function(a,b,c,d,e,f){e.exports={UNKNOWN:"attach:unknown",PHOTO:"attach:image",VIDEO:"attach:video",MSWORD:"attach:ms:word",VOICE:"attach:voice",MSPPT:"attach:ms:ppt",TEXT:"attach:text",MUSIC:"attach:music",MSXLS:"attach:ms:xls"};});
  9. __d("MercuryAttachmentType",[],function(a,b,c,d,e,f){e.exports={STICKER:"sticker",PHOTO:"photo",FILE:"file",SHARE:"share",ERROR:"error"};});
  10. __d("MercuryErrorType",[],function(a,b,c,d,e,f){e.exports={SERVER:1,TRANSPORT:2,TIMEOUT:3};});
  11. __d("MercuryGenericConstants",[],function(a,b,c,d,e,f){e.exports={PENDING_THREAD_ID:"pending:pending"};});
  12. __d("MercuryGlobalActionType",[],function(a,b,c,d,e,f){e.exports={MARK_ALL_READ:"mga-type:mark-all-read"};});
  13. __d("MercuryLogMessageType",[],function(a,b,c,d,e,f){e.exports={SERVER_ERROR:"log:error-msg",UNSUBSCRIBE:"log:unsubscribe",JOINABLE_JOINED:"log:joinable-joined",JOINABLE_CREATED:"log:joinable-created",LIVE_LISTEN:"log:live-listen",PHONE_CALL:"log:phone-call",THREAD_IMAGE:"log:thread-image",THREAD_NAME:"log:thread-name",VIDEO_CALL:"log:video-call",SUBSCRIBE:"log:subscribe"};});
  14. __d("MercuryMessageSourceTags",[],function(a,b,c,d,e,f){e.exports={CHAT:"source:chat",MOBILE:"source:mobile",MESSENGER:"source:messenger",EMAIL:"source:email"};});
  15. __d("MercuryParticipantTypes",[],function(a,b,c,d,e,f){e.exports={FRIEND:"friend",USER:"user",THREAD:"thread",EVENT:"event",PAGE:"page"};});
  16. __d("MercuryPayloadSource",[],function(a,b,c,d,e,f){e.exports={SERVER_INITIAL_DATA:"server_initial_data",CLIENT_DELETE_THREAD:"client_delete_thread",SERVER_ZAP:"server_zap",SERVER_SAVE_DRAFT:"server_save_draft",SERVER_CHANGE_ARCHIVED_STATUS:"server_change_archived_status",SERVER_SEARCH:"server_search",CLIENT_CHANGE_MUTE_SETTINGS:"client_change_mute_settings",SERVER_UNREAD_THREADS:"server_unread_threads",SERVER_MARK_SEEN:"server_mark_seen",SERVER_THREAD_SYNC:"server_thread_sync",CLIENT_DELETE_MESSAGES:"client_delete_messages",SERVER_FETCH_THREADLIST_INFO:"server_fetch_threadlist_info",CLIENT_CHANNEL_MESSAGE:"client_channel_message",CLIENT_CHANGE_FOLDER:"client_change_folder",CLIENT_CHANGE_READ_STATUS:"client_change_read_status",CLIENT_CLEAR_CHAT:"client_clear_chat",SERVER_FETCH_THREAD_INFO:"server_fetch_thread_info",SERVER_CHANGE_READ_STATUS:"server_change_read_status",SERVER_SEND_MESSAGE:"server_send_message",CLIENT_SAVE_DRAFT:"client_save_draft",UNKNOWN:"unknown",SERVER_MARK_FOLDER_READ:"server_mark_folder_read",SERVER_CONFIRM_MESSAGES:"server_confirm_messages",SERVER_TAB_PRESENCE:"server_tab_presence",CLIENT_CHANGE_ARCHIVED_STATUS:"client_change-archived_status",CLIENT_SEND_MESSAGE:"client_send_message",CLIENT_HANDLE_ERROR:"client_handle_error"};});
  17. __d("MercurySourceType",[],function(a,b,c,d,e,f){e.exports={GIGABOXX_BLAST:"source:gigaboxx:blast",TITAN_FACEWEB_BUFFY:"source:titan:faceweb_buffy",TITAN_FACEWEB_UNKNOWN:"source:titan:faceweb_unknown",CHAT_WEB:"source:chat:web",WEBRTC_MOBILE:"source:webrtc:mobile",GIGABOXX_API:"source:gigaboxx:api",TITAN_M_JAPAN:"source:titan:m_japan",BUFFY_SMS:"source:buffy:sms",SEND_PLUGIN:"source:sendplugin",CHAT_MEEBO:"source:chat:meebo",TITAN_FACEWEB_IPAD:"source:titan:faceweb_ipad",TITAN_FACEWEB_IPHONE:"source:titan:faceweb_iphone",TEST:"source:test",WEB:"source:web",SOCIALFOX:"source:socialfox",EMAIL:"source:email",TITAN_API:"source:titan:api",GIGABOXX_WEB:"source:gigaboxx:web",DESKTOP:"source:desktop",TITAN_FACEWEB_ANDROID:"source:titan:faceweb_android",LEIA:"source:leia",CHAT_JABBER:"source:chat:jabber",CHAT_TEST:"source:chat:test",SHARE_DIALOG:"source:share:dialog",GIGABOXX_WAP:"source:gigaboxx:wap",CHAT:"source:chat",TITAN_M_APP:"source:titan:m_app",TITAN_M_TOUCH:"source:titan:m_touch",TITAN_ORCA:"source:titan:orca",TITAN_WAP:"source:titan:wap",TITAN_EMAIL_REPLY:"source:titan:emailreply",CHAT_IPHONE:"source:chat:iphone",SMS:"source:sms",TITAN_M_BASIC:"source:titan:m_basic",TITAN_M_MINI:"source:titan:m_mini",GIGABOXX_MOBILE:"source:gigaboxx:mobile",UNKNOWN:"source:unknown",TITAN_WEB:"source:titan:web",TITAN_M_ZERO:"source:titan:m_zero",MOBILE:"source:mobile",PAID_PROMOTION:"source:paid_promotion",TITAN_API_MOBILE:"source:titan:api_mobile",HELPCENTER:"source:helpcenter",GIGABOXX_EMAIL_REPLY:"source:gigaboxx:emailreply",CHAT_ORCA:"source:chat:orca",TITAN_M_TALK:"source:titan:m_talk",NEW_SHARE_DIALOG:"source:share:dialog:new"};});
  18. __d("MercuryThreadMode",[],function(a,b,c,d,e,f){e.exports={EMAIL_ORIGINATED:1,OBJECT_ORIGINATED:3,TITAN_ORIGINATED:2};});
  19. __d("MercuryTimePassed",[],function(a,b,c,d,e,f){e.exports={TODAY:0,WEEK_AGO:1,CURRENT_YEAR:3,OTHER_YEAR:4,MONTH_AGO:2};});
  20. __d("MessagingEvent",[],function(a,b,c,d,e,f){e.exports={UNSUBSCRIBE:"unsubscribe",DELIVERY_RECEIPT:"delivery_receipt",REPORT_SPAM_MESSAGES:"report_spam_messages",DELIVER_FAST_PAST:"deliver_fast_path",DELETE_MESSAGES:"delete_messages",READ_RECEIPT:"read_receipt",SENT_PUSH:"sent_push",READ:"read",CHANGE_MUTE_SETTINGS:"change_mute_settings",ERROR:"error",UNMARK_SPAM:"unmark_spam",UNREAD:"unread",DELIVER_LOG:"deliver_log",DELIVER:"deliver",READ_ALL:"read_all",TAG:"tag",MORE_THREADS:"more_threads",DELETE:"delete",REPORT_SPAM:"report_spam",SUBSCRIBE:"subscribe"};});
  21. __d("MessagingTag",[],function(a,b,c,d,e,f){e.exports={MTA_SYSTEM_MESSAGE:"MTA:system_message",SENT:"sent",INBOX:"inbox",SMS_TAG_ROOT:"SMSShortcode:",UPDATES:"broadcasts_inbox",OTHER:"other",GROUPS:"groups",FILTERED_CONTENT:"filtered_content",ACTION_ARCHIVED:"action:archived",UNREAD:"unread",BCC:"header:bcc",SMS_MUTE:"sms_mute",ARCHIVED:"archived",DOMAIN_AUTH_PASS:"MTA:dmarc:pass",EVENT:"event",VOICEMAIL:"voicemail",DOMAIN_AUTH_FAIL:"MTA:dmarc:fail",SPAM_SPOOFING:"spam:spoofing",SPOOF_WARNING:"MTA:spoof_warning",SPAM:"spam",EMAIL_MESSAGE:"source:email",EMAIL:"email",APP_ID_ROOT:"app_id:"};});
  22. __d("AvailableListConstants",[],function(a,b,c,d,e,f){var g={ON_AVAILABILITY_CHANGED:'buddylist/availability-changed',ON_UPDATE_ERROR:'buddylist/update-error',ON_UPDATED:'buddylist/updated',ON_CHAT_NOTIFICATION_CHANGED:'chat-notification-changed',OFFLINE:0,IDLE:1,ACTIVE:2,MOBILE:3,LEGACY_OVERLAY_OFFLINE:-1,LEGACY_OVERLAY_ONLINE:0,LEGACY_OVERLAY_IDLE:1,legacyStatusMap:{'0':2,'1':1,'-1':0,'2':3},reverseLegacyStatusMap:{0:-1,1:1,2:0,3:2}};a.AvailableListConstants=e.exports=g;});
  23. __d("PresenceUtil",["Cookie","Env","randomInt","tx"],function(a,b,c,d,e,f){var g=b('Cookie'),h=b('Env'),i=b('randomInt'),j=b('tx'),k=i(0,4294967295)+1,l={checkMaintenanceError:function(m){if(m.getError()==1356007)return true;return false;},getErrorDescription:function(m){var n=m.getError(),o=m.getErrorDescription();if(!o)o="An error occurred.";if(n==1357001)o="Your session has timed out. Please log in.";return o;},getSessionID:function(){return k;},hasUserCookie:function(){return h.user===g.get('c_user');}};e.exports=l;});
  24. __d("PresencePrivacy",["hasArrayNature","Arbiter","AsyncRequest","ChannelConstants","copyProperties","Env","JSLogger","PresenceUtil","PresencePrivacyInitialData"],function(a,b,c,d,e,f){var g=b('hasArrayNature'),h=b('Arbiter'),i=b('AsyncRequest'),j=b('ChannelConstants'),k=b('copyProperties'),l=b('Env'),m=b('JSLogger'),n=b('PresenceUtil'),o=b('PresencePrivacyInitialData'),p='/ajax/chat/privacy/settings.php',q='/ajax/chat/privacy/online_policy.php',r='/ajax/chat/privacy/visibility.php',s='friend_visibility',t='visibility',u='online_policy',v=k({},o.privacyData),w=o.visibility,x=k({},o.privacyData),y=w,z=o.onlinePolicy,aa=z,ba=[],ca=false;function da(){return m.create('blackbird');}var ea=k(new h(),{WHITELISTED:1,BLACKLISTED:-1,UNLISTED:0,ONLINE:1,OFFLINE:0,ONLINE_TO_WHITELIST:0,ONLINE_TO_BLACKLIST:1});function fa(ra){var sa;for(sa in ra){var ta=ra[sa];if(sa==l.user){da().error('set_viewer_visibility');throw new Error("Invalid to set current user's visibility");}switch(ta){case ea.WHITELISTED:case ea.BLACKLISTED:case ea.UNLISTED:break;default:da().error('set_invalid_friend_visibility',{id:sa,value:ta});throw new Error("Invalid state: "+ta);}}for(sa in ra)v[sa]=ra[sa];ea.inform('privacy-changed');}function ga(ra,sa){var ta={};ta[ra]=sa;fa(ta);}function ha(ra){switch(ra){case ea.ONLINE:case ea.OFFLINE:break;default:da().error('set_invalid_visibility',{value:ra});throw new Error("Invalid visibility: "+ra);}w=ra;ea.inform('privacy-changed');ea.inform('privacy-user-presence-changed');h.inform('chat/visibility-changed',{sender:this});}function ia(ra){switch(ra){case ea.ONLINE_TO_WHITELIST:case ea.ONLINE_TO_BLACKLIST:break;default:throw new Error("Invalid default online policy: "+ra);}z=ra;ea.inform('privacy-user-presence-changed');ea.inform('privacy-changed');}function ja(ra,sa){ca=true;ra.send();}function ka(ra,sa){ba.push({request:ra,data:sa});if(!ca){var ta=ba.shift();ja(ta.request,ta.data);}}function la(ra,sa){var ta=ra.type;if(ta===s){var ua=sa.payload.user_availabilities;if(!g(ua)){ea.inform('privacy-availability-changed',{user_availabilities:ua});for(var va in ra.settings)x[va]=ra.settings[va];}}else{if(ta===t){y=ra.visibility;}else if(ta===u)aa=ra.online_policy;ea.inform('privacy-user-presence-response');}da().log('set_update_response',{data:ra,response:sa});}function ma(ra,sa){if(w!==y)ha(y);if(z!==aa)ia(aa);k(v,x);ea.inform('privacy-changed');ba=[];da().log('set_error_response',{data:ra,response:sa});}function na(ra){ca=false;if(ba.length>0){var sa=ba.shift();ja(sa.request,sa.data);}}function oa(ra,sa){if(n!=null){var ta=ra.getData();ta.window_id=n.getSessionID();ra.setData(ta);}ra.setHandler(la.bind(this,sa)).setErrorHandler(ma.bind(this,sa)).setTransportErrorHandler(ma.bind(this,sa)).setFinallyHandler(na.bind(this)).setAllowCrossPageTransition(true);return ra;}function pa(ra,sa,ta){return oa(new i(ra).setData(sa),ta);}function qa(ra,sa){var ta=sa.obj;if(ta.viewer_id!=l.user){da().error('invalid_viewer_for_channel_message',{type:ra,data:sa});throw new Error("Viewer got from the channel is not the real viewer");}if(ta.window_id===n.getSessionID())return;var ua=ta.data;if(ta.event=='access_control_entry'){ua.target_ids.forEach(function(wa){ga(wa,ua.setting);x[wa]=ua.setting;});}else{if(ta.event=='visibility_update'){var va=!!ua.visibility?ea.ONLINE:ea.OFFLINE;ha(va);y=va;}else if(ta.event=='online_policy_update'){ia(ua.online_policy);aa=ua.online_policy;}ea.inform('privacy-user-presence-response');}da().log('channel_message_received',{data:sa.obj});}k(ea,{WHITELISTED:1,BLACKLISTED:-1,UNLISTED:0,ONLINE:1,OFFLINE:0,ONLINE_TO_WHITELIST:0,ONLINE_TO_BLACKLIST:1,init:function(ra,sa,ta){},setVisibility:function(ra){y=w;ha(ra);var sa={visibility:ra},ta={type:t,visibility:ra},ua=pa(r,sa,ta);ka(ua,ta);da().log('set_visibility',{data:sa});return ra;},getVisibility:function(){return w;},setOnlinePolicy:function(ra){aa=z;ia(ra);var sa={online_policy:ra},ta={type:u,online_policy:ra},ua=pa(q,sa,ta);ka(ua,ta);da().log('set_online_policy',{data:sa});return ra;},getOnlinePolicy:function(){return z;},getFriendVisibility:function(ra){return v[ra]||ea.UNLISTED;},allows:function(ra){if(this.getVisibility()===ea.OFFLINE)return false;var sa=this.getOnlinePolicy();return sa===ea.ONLINE_TO_WHITELIST?v[ra]==ea.WHITELISTED:v[ra]!=ea.BLACKLISTED;},setFriendsVisibility:function(ra,sa){if(ra.length>0){var ta={};for(var ua=0;ua<ra.length;ua++){var va=ra[ua];x[va]=v[va];ta[va]=sa;}fa(ta);var wa=sa;if(wa==ea.UNLISTED)wa=x[ra[0]];var xa={users:ra,setting:sa,setting_type:wa},ya={type:s,settings:ta},za=pa(p,xa,ya);ka(za,ya);da().log('set_friend_visibility',{data:xa});}return sa;},setFriendVisibilityMap:function(ra,sa){for(var ta in ra)x[ta]=v[ta];fa(ra);var ua={type:s,settings:ra};ka(oa(sa,ua),ua);da().log('set_friend_visibility_from_map',{data:ra});},allow:function(ra){if(this.allows(ra)){da().error('allow_already_allowed');throw new Error("allow() should only be called for users that "+"are not already allowed");}if(this.getVisibility()===ea.OFFLINE){da().error('allow_called_while_offline');throw new Error("allow() should only be called when the user is already online");}var sa=this.getOnlinePolicy()===ea.ONLINE_TO_WHITELIST?ea.WHITELISTED:ea.UNLISTED;return this.setFriendsVisibility([ra],sa);},disallow:function(ra){if(!this.allows(ra)){da().error('disallow_already_disallowed');throw new Error("disallow() should only be called for users that "+"are not already disallowed");}if(this.getVisibility()===ea.OFFLINE){da().error('disallow_called_while_offline');throw new Error("disallow() should only be called when the user is already online");}var sa=this.getOnlinePolicy()===ea.ONLINE_TO_BLACKLIST?ea.BLACKLISTED:ea.UNLISTED;return this.setFriendsVisibility([ra],sa);},getBlacklist:function(){var ra=[];for(var sa in v)if(v[sa]===ea.BLACKLISTED)ra.push(sa);return ra;},getWhitelist:function(){var ra=[];for(var sa in v)if(v[sa]===ea.WHITELISTED)ra.push(sa);return ra;},getMapForTest:function(){return v;},setMapForTest:function(ra){v=ra;}});ea.inform('privacy-changed');ea.inform('privacy-user-presence-changed');da().log('initialized',{visibility:w,policy:z});h.subscribe(j.getArbiterType('privacy_changed'),qa.bind(this));h.subscribe(j.ON_CONFIG,function(ra,sa){var ta=sa.getConfig('visibility',null);if(ta!==null&&typeof(ta)!=='undefined'){var ua=ta?ea.ONLINE:ea.OFFLINE;ha(ua);da().log('config_visibility',{vis:ua});}}.bind(this));a.PresencePrivacy=e.exports=ea;},3);
  25. __d("ChatVisibility",["Arbiter","JSLogger","PresencePrivacy"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('JSLogger'),i=b('PresencePrivacy'),j={isOnline:function(){return i.getVisibility()===i.ONLINE;},hasBlackbirdEnabled:function(){return this.isVisibleToMostFriends()||this.isVisibleToSomeFriends();},isVisibleToMostFriends:function(){return i.getOnlinePolicy()===i.ONLINE_TO_BLACKLIST&&i.getBlacklist().length>0;},isVisibleToSomeFriends:function(){return i.getOnlinePolicy()===i.ONLINE_TO_WHITELIST&&i.getWhitelist().length>0;},goOnline:function(k){if(i.getVisibility()===i.OFFLINE){h.create('blackbird').log('chat_go_online');i.setVisibility(i.ONLINE);g.inform('chat-visibility/go-online');}k&&k();},goOffline:function(k){if(i.getVisibility()===i.ONLINE){h.create('blackbird').log('chat_go_offline');i.setVisibility(i.OFFLINE);g.inform('chat-visibility/go-offline');}k&&k();},toggleVisibility:function(){if(j.isOnline()){j.goOffline();}else j.goOnline();}};a.ChatVisibility=e.exports=j;},3);
  26. __d("MercuryIDs",[],function(a,b,c,d,e,f){function g(i){return typeof i==='string'&&i.indexOf(':')!==-1;}var h={isValid:function(i){if(!i)return false;return g(i);},isValidThreadID:function(i){if(!h.isValid(i))return false;var j=h.tokenize(i);switch(j.type){case 'user':case 'group':case 'thread':case 'root':case 'pending':return true;default:return false;}},tokenize:function(i){if(!this.isValid(i))throw 'bad_id_format';var j=i.indexOf(':');return {type:i.substr(0,j),value:i.substr(j+1)};},getUserIDFromParticipantID:function(i){if(!h.isValid(i))return null;var j=h.tokenize(i);if(j.type!='fbid')return null;return j.value;}};e.exports=h;});
  27. __d("MercuryAssert",["MercuryIDs"],function(a,b,c,d,e,f){var g=b('MercuryIDs');e.exports={isParticipantID:function(h){if(!g.isValid(h))throw 'bad_participant_id';},allParticipantIDs:function(h){h.forEach(this.isParticipantID);},isUserParticipantID:function(h){var i=g.tokenize(h);if(i.type!='fbid')throw 'bad_user_id';},isEmailParticipantID:function(h){var i=g.tokenize(h);if(i.type!='email')throw 'bad_email_id';},allThreadID:function(h){h.forEach(this.isThreadID);},isThreadID:function(h){if(!g.isValid(h))throw 'bad_thread_id';}};});
  28. __d("MercurySingletonMixin",["Env"],function(a,b,c,d,e,f){var g=b('Env'),h={_getInstances:function(){if(!this._instances)this._instances={};return this._instances;},get:function(){return this.getForFBID(g.user);},getForFBID:function(i){var j=this._getInstances();if(!j[i])j[i]=new this(i);return j[i];}};e.exports=h;});
  29. __d("MercuryMessageIDs",["KeyedCallbackManager"],function(a,b,c,d,e,f){var g=b('KeyedCallbackManager'),h=new g(),i={getServerIDs:function(j,k){var l=j.filter(function(n){return n.indexOf('mail.projektitan.com')!==-1;}),m=function(n){var o=j.map(function(p){return n[p]?n[p]:p;});k(o);};return h.executeOrEnqueue(l,m);},addServerID:function(j,k){h.setResource(j,k);}};e.exports=i;});
  30. __d("ImageSourceType",[],function(a,b,c,d,e,f){var g={PROFILE_PICTURE:'profile_picture',IMAGE:'image'};e.exports=g;});
  31. __d("PhotoResizeModeConst",[],function(a,b,c,d,e,f){var g={COVER:'s',CONTAIN:'p'};e.exports=g;});
  32. __d("ImageSourceRequest",["arrayContains","extendArray","copyProperties","Env","KeyedCallbackManager","ImageSourceType","PhotoResizeModeConst","MercuryServerDispatcher"],function(a,b,c,d,e,f){var g=b('arrayContains'),h=b('extendArray'),i=b('copyProperties'),j=b('Env'),k=b('KeyedCallbackManager'),l=b('ImageSourceType'),m=b('PhotoResizeModeConst'),n=b('MercuryServerDispatcher');function o(){this._request={fbid:null,type:null,width:null,height:null,resize_mode:null};this._callback=null;}i(o.prototype,{setFBID:function(s){this._request.fbid=s;return this;},setType:function(s){if(!g([l.PROFILE_PICTURE,l.IMAGE],s))throw new TypeError('ImageSourceRequest.setType: invalid type '+s);this._request.type=s;return this;},setDimensions:function(s,t){this._request.width=s;this._request.height=t;return this;},setResizeMode:function(s){if(!g([m.COVER,m.CONTAIN],s))throw new TypeError('ImageSourceRequest.setResizeMode: invalid resize mode '+s);this._request.resize_mode=s;return this;},setCallback:function(s){this._callback=s;return this;},send:function(){if(!this._request.fbid||!this._request.width||!this._request.height||!this._request.type||!this._request.resize_mode||!this._callback)throw new Error('ImageSourceRequest: You must set all the fields');var s=q(),t=r(this._request);s.executeOrEnqueue(t,this._callback);if(s.getUnavailableResourcesFromRequest(t).length===1){n.trySend('/ajax/image_source.php',{requests:[this._request]});return true;}return false;}});var p=null;function q(){if(p)return p;var s=new k();p=s;n.registerEndpoints({'/ajax/image_source.php':{request_user_id:j.user,mode:n.BATCH_DEFERRED_MULTI,batch_function:function(t,u){h(t.requests,u.requests);return t;},handler:function(t,u){var v=u.getData().requests;for(var w=0;w<v.length;++w)s.setResource(r(v[w]),t[w]);}}});return s;}function r(s){return [s.fbid,s.type,s.width,s.height,s.resize_mode].join('|');}e.exports=o;});
  33. __d("TimestampConverter",["JSLogger"],function(a,b,c,d,e,f){var g=b('JSLogger'),h=g.create('timestamp_converter');function i(k){return (typeof(k)=='string')&&k.length>6;}var j={convertActionIDToTimestamp:function(k){if(i(k)){var l=k.slice(0,-6);return parseInt(l,10);}},maxValidActionID:function(k,l){if(!i(k))return l;if(!i(l))return k;return this.isGreaterThan(k,l)?k:l;},isGreaterThan:function(k,l){if(!i(k)||!i(l))return false;return this.convertActionIDToTimestamp(k)>this.convertActionIDToTimestamp(l);}};e.exports=j;});
  34. __d("MessagingReliabilityLogger",["function-extensions","PresenceUtil","MercuryServerDispatcher","MessagingReliabilityLoggerInitialData","isEmpty","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f){b('function-extensions');var g=b('PresenceUtil'),h=b('MercuryServerDispatcher'),i=b('MessagingReliabilityLoggerInitialData'),j=b('isEmpty'),k=b('setTimeoutAcrossTransitions'),l='/ajax/mercury/client_reliability.php',m=60000;function n(t,u){var v={app:i.app,categories:JSON.stringify(t)};if(!j(u))v.extra=JSON.stringify(u);return v;}function o(t,u,v,w){if(t[u]===undefined)t[u]={};if(t[u][v]===undefined)t[u][v]=0;t[u][v]+=w;}function p(t,u,v,w){if(t[u]===undefined)t[u]={};if(t[u][v]===undefined)t[u][v]=[];for(var x=0;x<w.length;++x)t[u][v].push(w[x]);}function q(t,u){if((t&&!t.categories)||(u&&!u.categories))return;var v=t?JSON.parse(t.categories):{},w=t&&t.extra?JSON.parse(t.extra):{},x=JSON.parse(u.categories),y=u.extra?JSON.parse(u.extra):{};for(var z in x){var aa=x[z],ba=y[z];for(var ca in aa){o(v,z,ca,aa[ca]);if(ba!==undefined){var da=ba[ca];if(da!==undefined)p(w,z,ca,da);}}}return n(v,w);}var r={};r[l]={mode:h.BATCH_SUCCESSIVE_PIGGYBACK_ON_ERROR,batch_function:q};h.registerEndpoints(r);var s={addEntry:function(t,u,v){if(!i.enabled)return;var w={};o(w,t,u,1);var x={};if(v!==undefined)p(x,t,u,[v]);h.trySend(l,n(w,x));}};(function t(){s.addEntry('page_event','active',g.getSessionID());k(t,m);})();e.exports=s;});
  35. __d("MercuryThreadInformer",["ArbiterMixin","copyProperties","MercuryAssert","MercurySingletonMixin"],function(a,b,c,d,e,f){var g=b('ArbiterMixin'),h=b('copyProperties'),i=b('MercuryAssert'),j=b('MercurySingletonMixin');function k(m){if(!m._locked){var n=m._threadDeletions,o=m._threadChanges,p=m._threadReadChanges,q=m._threadlistChanged,r=m._unseenStateChanged,s=m._unreadStateChanged,t=m._receivedMessages,u=m._reorderedMessages,v=m._updatedMessages;m._threadDeletions={};m._threadChanges={};m._threadReadChanges={};m._threadlistChanged=false;m._unseenStateChanged=false;m._unreadStateChanged=false;m._receivedMessages={};m._reorderedMessages={};m._updatedMessages={};var w=Object.keys(o);if(w.length||q)m.inform('threadlist-updated',w);if(w.length)m.inform('threads-updated',o);for(var x in p){m.inform('thread-read-changed',p);break;}for(var x in n){m.inform('threads-deleted',n);break;}if(r)m.inform('unseen-updated',null);if(s)m.inform('unread-updated',null);for(x in t){m.inform('messages-received',t);break;}for(x in u){m.inform('messages-reordered',u);break;}for(x in v){m.inform('messages-updated',v);break;}}}function l(m){this._fbid=m;this._threadDeletions={};this._threadChanges={};this._threadReadChanges={};this._threadlistChanged=false;this._unseenStateChanged=false;this._unreadStateChanged=false;this._receivedMessages={};this._reorderedMessages={};this._updatedMessages={};this._locked=0;}h(l.prototype,g,{updatedThread:function(m){this._threadChanges[m]=true;k(this);},deletedThread:function(m){this._threadDeletions[m]=true;k(this);},updatedThreadlist:function(){this._threadlistChanged=true;k(this);},updatedUnseenState:function(){this._unseenStateChanged=true;k(this);},updatedUnreadState:function(){this._unreadStateChanged=true;k(this);},changedThreadReadState:function(m,n,o){if(!this._threadReadChanges[m]||this._threadReadChanges[m].timestamp<o)this._threadReadChanges[m]={mark_as_read:n,timestamp:o};k(this);},receivedMessage:function(m){i.isThreadID(m.thread_id);var n=m.thread_id;if(!this._receivedMessages[n])this._receivedMessages[n]=[];this._receivedMessages[n].push(m);this.updatedThread(n);},reorderedMessages:function(m,n){this._reorderedMessages[m]={source:n};k(this);},updatedMessage:function(m,n,o){if(!this._updatedMessages[m])this._updatedMessages[m]={};this._updatedMessages[m][n]={source:o};this.updatedThread(m);},synchronizeInforms:function(m){this._locked++;try{m();}catch(n){throw n;}finally{this._locked--;k(this);}},listen:function(m,n){return this.subscribe('threads-updated',function(o,p){if(p[m])n(m);});}});h(l,j);e.exports=l;});
  36. __d("MercuryServerRequests",["ArbiterMixin","AsyncResponse","TimestampConverter","Env","JSLogger","KeyedCallbackManager","MercuryActionTypeConstants","MercuryActionStatus","MercuryAPIArgsSource","MercuryAssert","MercuryErrorType","MercuryGenericConstants","MercuryGlobalActionType","MercuryIDs","MercuryLogMessageType","MercuryPayloadSource","MercuryServerRequestsConfig","MercurySourceType","MercuryThreadlistConstants","MercuryMessageIDs","MessagingConfig","MessagingReliabilityLogger","MessagingTag","MercurySingletonMixin","MercuryServerDispatcher","MercuryThreadInformer","copyProperties","createObjectFrom"],function(a,b,c,d,e,f){var g=b('ArbiterMixin'),h=b('AsyncResponse'),i=b('TimestampConverter'),j=b('Env'),k=b('JSLogger'),l=b('KeyedCallbackManager'),m=b('MercuryActionTypeConstants'),n=b('MercuryActionStatus'),o=b('MercuryAPIArgsSource'),p=b('MercuryAssert'),q=b('MercuryErrorType'),r=b('MercuryGenericConstants'),s=b('MercuryGlobalActionType'),t=b('MercuryIDs'),u=b('MercuryLogMessageType'),v=b('MercuryPayloadSource'),w=b('MercuryServerRequestsConfig'),x=b('MercurySourceType'),y=b('MercuryThreadlistConstants'),z=b('MercuryMessageIDs'),aa=b('MessagingConfig'),ba=b('MessagingReliabilityLogger'),ca=b('MessagingTag'),da=b('MercurySingletonMixin'),ea=b('MercuryServerDispatcher'),fa=b('MercuryThreadInformer'),ga=b('copyProperties'),ha=b('createObjectFrom'),ia=k.create('mercury_server'),ja=o.MERCURY;function ka(sb,tb){if(tb)sb._lastActionId=i.maxValidActionID(sb._lastActionId,tb);}function la(sb,tb){var ub=tb.thread_id,vb=sb._serverToClientIDs.getResource(ub);if(!vb){if(tb.canonical_fbid){vb='user:'+tb.canonical_fbid;}else if(tb.root_message_threading_id)vb='root:'+tb.root_message_threading_id;vb=vb||'thread:'+ub;ma(sb,ub,vb);}tb.thread_id=vb;}function ma(sb,tb,ub){sb._serverToClientIDs.setResource(tb,ub);sb._clientToServerIDs.setResource(ub,tb);sb._newlyAddedClientIDs[tb]=ub;}function na(sb,tb,ub){var vb=sb._clientToServerIDs.executeOrEnqueue(tb,ub),wb=sb._clientToServerIDs.getUnavailableResources(vb),xb=sb.tokenizeThreadID(tb);if(wb.length&&xb.type!='root')sb.fetchThreadData(wb);}function oa(sb,tb){return sb._clientToServerIDs.getResource(tb);}function pa(sb,tb){return !!sb._serverToClientIDs.getResource(tb);}function qa(sb,tb){var ub=sb._serverToClientIDs.getResource(tb);if(typeof ub=='undefined')ia.warn('no_client_thread_id',{server_id:tb});return ub;}function ra(sb,tb,ub){sb._serverToClientIDs.executeOrEnqueue(tb,ub);sb.ensureThreadIsFetched(tb);}function sa(sb,tb,ub){if(tb.action_type!=m.SEND_MESSAGE)return;var vb=tb.client_thread_id;if(!vb)vb=qa(sb,tb.thread_id);var wb=null;if(vb)wb=t.tokenize(vb).type;ba.addEntry('send_'+wb,ub,tb.thread_id+','+tb.message_id);}function ta(sb){return sb.getError()?'_'+sb.getError():'';}function ua(sb,tb){var ub=null;switch(tb.status){case n.SUCCESS:ub='success';break;case n.FAILED_UNKNOWN_REASON:ub='confirmed_error';break;case n.UNABLE_TO_CONFIRM:ub='confirm_error';break;default:return;}sa(sb,tb,ub);}function va(sb,tb){(tb.message_counts||[]).forEach(function(cc){ka(sb,cc.last_action_id);});(tb.threads||[]).forEach(function(cc){la(sb,cc);delete sb._fetchingThreads[cc.thread_id];var dc=oa(sb,cc.thread_id);delete sb._fetchingThreads[dc];ka(sb,cc.last_action_id);});(tb.ordered_threadlists||[]).forEach(function(cc){cc.thread_ids=cc.thread_ids.map(qa.curry(sb));});tb.actions=tb.actions||[];tb.actions.forEach(function(cc){ua(sb,cc);if(cc.status&&cc.status!=n.SUCCESS&&!cc.thread_id){cc.thread_id=cc.client_thread_id;return;}if(cc.action_type==m.SEND_MESSAGE&&cc.client_thread_id&&cc.client_thread_id!=r.PENDING_THREAD_ID)ma(sb,cc.thread_id,cc.client_thread_id);cc.server_thread_id=cc.thread_id;cc.thread_id=pa(sb,cc.thread_id)?qa(sb,cc.thread_id):null;ka(sb,cc.action_id);});if(tb.end_of_history){var ub=[];for(var vb=0;vb<tb.end_of_history.length;vb++){var wb=tb.end_of_history[vb];if(wb.type=='user'){ub.push('user:'+wb.id);}else if(wb.type=='thread'&&pa(sb,wb.id))ub.push(qa(sb,wb.id));}tb.end_of_history=ub;}if(tb.roger){var xb={};for(var yb in tb.roger){var zb=sb._serverToClientIDs.getResource(yb);if(zb){var ac=tb.roger[yb];xb[zb]={};for(var bc in ac)xb[zb]['fbid:'+bc]=ac[bc];}}tb.roger=xb;}}function wa(sb){if(sb._pendingUpdates&&sb._pendingUpdates.length){var tb=sb._pendingUpdates[0];sb._pendingUpdates=sb._pendingUpdates.slice(1);sb.handleUpdate(tb);}}function xa(sb,tb){var ub=ga({},sb),vb;if(tb.threads){if(!ub.threads)ub.threads={};for(vb in tb.threads)ub.threads[vb]=Object.keys(ha((ub.threads[vb]||[]).concat(tb.threads[vb])));}if(tb.messages){if(!ub.messages)ub.messages={};for(vb in tb.messages){if(!ub.messages[vb])ub.messages[vb]={};for(var wb in tb.messages[vb])if(ub.messages[vb][wb]){ub.messages[vb][wb]=ab(ub.messages[vb][wb],tb.messages[vb][wb]);}else ub.messages[vb][wb]=tb.messages[vb][wb];}}ub.client=sb.client||tb.client;return ub;}function ya(sb,tb){var ub=ga(ha(sb.folders,true),ha(tb.folders,true)),vb=sb.client||tb.client;return {folders:Object.keys(ub),client:vb};}function za(sb,tb){for(var ub in tb)if(sb[ub]&&typeof sb[ub]==='object'){sb[ub]=ab(sb[ub],tb[ub]);}else if(tb[ub]&&typeof tb[ub]==='object'){var vb={};ga(vb,tb[ub]);sb[ub]=vb;}return sb;}function ab(sb,tb){var ub=sb.offset<tb.offset?sb.offset:tb.offset,vb=sb.offset+sb.limit,wb=tb.offset+tb.limit,xb=(vb>wb)?vb:wb,yb=xb-ub;return {offset:ub,limit:yb};}function bb(sb,tb){var ub=sb.client||tb.client,vb={ids:{},client:ub};ga(vb.ids,sb.ids);ga(vb.ids,tb.ids);return vb;}function cb(sb,tb){var ub={},vb,wb=sb.client||tb.client;delete sb.client;delete tb.client;for(vb in sb)ga(ub,ha(sb[vb],vb));for(vb in tb)ga(ub,ha(tb[vb],vb));var xb={client:wb};for(var yb in ub){vb=ub[yb];if(!xb[vb])xb[vb]=[];xb[vb].push(yb);}return xb;}function db(sb,tb){var ub=sb.client||tb.client,vb=ha(sb.ids,true),wb=ha(tb.ids,true),xb=ga(vb,wb);return {ids:Object.keys(xb),client:ub};}function eb(sb){this._fbid=sb;this._lastActionId=0;this._serverToClientIDs=new l();this._clientToServerIDs=new l();this._pendingUpdates=[];this._fetchingThreads={};this._newlyAddedClientIDs={};qb(this);}ga(eb.prototype,g,{tokenizeThreadID:function(sb){p.isThreadID(sb);return t.tokenize(sb);},getServerThreadID:function(sb,tb){p.isThreadID(sb);na(this,sb,tb);},getClientThreadID:function(sb,tb){ra(this,sb,tb);},getClientThre
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement