private MNPopup.MNPopupAction _ReportActivityById(ReportingReason reportingReason)
 {
     return(() =>
     {
         GetSocial.ReportActivity(_activityId, reportingReason, () =>
         {
             _console.LogD(string.Format("Activity {0} reported as {1}!", _activityId, reportingReason));
         }, OnError);
     });
 }
        public static THReportingReason ToRpcModel(this ReportingReason reportingReason)
        {
            switch (reportingReason)
            {
            case ReportingReason.InappropriateContent: return(THReportingReason.INAPPROPRIATE_CONTENT);

            case ReportingReason.Spam: return(THReportingReason.SPAM);

            default: return(THReportingReason.SPAM);
            }
        }
 public void ReportActivity(string activityId, ReportingReason reportingReason, Action onSuccess, Action <GetSocialError> onFailure)
 {
     LogRequest("reportActivity", string.Format("activityId: {0}, reportingReason: {1}", activityId, reportingReason));
     WithHadesClient(client =>
     {
         var response = client.reportActivity(SessionId, activityId, reportingReason.ToRpcModel());
         Ui(() =>
         {
             LogResponse("reportActivity", response);
             onSuccess.SafeCall();
         });
     }, onFailure);
 }
Esempio n. 4
0
        /// <summary>
        /// Blocks a JID
        /// </summary>
        /// <param name="JID">JID to block.</param>
        /// <param name="Reason">Reason for blocking JID.</param>
        /// <param name="Callback">Callback method.</param>
        /// <param name="State">State object to pass on to callback method.</param>
        public void BlockJID(string JID, ReportingReason Reason, IqResultEventHandler Callback, object State)
        {
            bool Blocked;

            lock (this.blockList)
            {
                if (!this.blockList.TryGetValue(JID, out Blocked))
                {
                    Blocked = false;
                }
            }

            if (Blocked)
            {
                this.CallCallback(Callback, State, new IqResultEventArgs(null, string.Empty, string.Empty, string.Empty, true, State));
            }
            else if (this.supportsBlocking)
            {
                StringBuilder Xml = new StringBuilder();

                Xml.Append("<block xmlns='");
                Xml.Append(NamespaceBlocking);
                Xml.Append("'><item jid='");
                Xml.Append(JID);

                if (!this.supportsReporting)
                {
                    Xml.Append("'/></block>");
                }
                else if (Reason == ReportingReason.Spam && this.supportsSpamReason)
                {
                    Xml.Append("'><report xmlns='");
                    Xml.Append(NamespaceReporting);
                    Xml.Append("'><spam/></report></item></block>");
                }
                else if (Reason == ReportingReason.Abuse && this.supportsAbuseReason)
                {
                    Xml.Append("'><report xmlns='");
                    Xml.Append(NamespaceReporting);
                    Xml.Append("'><abuse/></report></item></block>");
                }
                else
                {
                    Xml.Append("'/></block>");
                }

                this.client.SendIqSet(this.client.Domain, Xml.ToString(), (sender, e) =>
                {
                    if (e.Ok)
                    {
                        lock (this.blockList)
                        {
                            this.blockList[JID] = true;
                        }
                    }

                    this.CallCallback(Callback, State, e);
                }, null);
            }
            else
            {
                this.CallCallback(Callback, State, new IqResultEventArgs(null, string.Empty, string.Empty, string.Empty, false, State));
            }
        }
 public void ReportActivity(string activityId, ReportingReason reportingReason, Action onSuccess, Action <GetSocialError> onFailure)
 {
     DebugUtils.LogMethodCall(MethodBase.GetCurrentMethod(), activityId, reportingReason, onSuccess, onFailure);
 }
 private void Report(Activity activity, ReportingReason reason, string explanation)
 {
     Communities.ReportActivity(activity.Id, reason, explanation, () => _console.LogD("Activity reported"), error => _console.LogE("Failed to report: " + error.Message));
 }
Esempio n. 7
0
 public static void ReportActivity(string activityId, ReportingReason reason, string explanation, Action onSuccess, Action <GetSocialError> onError)
 {
     GetSocialFactory.Bridge.ReportActivity(activityId, reason, explanation, onSuccess, onError);
 }
 public static AndroidJavaObject ToAndroidJavaObject(this ReportingReason reportingReason)
 {
     return(ToAndroidJavaObject((int)reportingReason, "im.getsocial.sdk.activities.ReportingReason"));
 }
Esempio n. 9
0
 public void ReportActivity(string activityId, ReportingReason reason, string explanation, Action onSuccess, Action <GetSocialError> onError)
 {
     CallAsyncVoid("Communities.reportActivity", GSJson.Serialize(new ReportActivityBody {
         Id = activityId, Reason = reason, Explanation = explanation
     }), onSuccess, onError);
 }
Esempio n. 10
0
 public void ReportActivity(string activityId, ReportingReason reportingReason, Action onSuccess, Action <GetSocialError> onFailure)
 {
     _gs_reportActivity(activityId, Convert.ToInt32(reportingReason),
                        Callbacks.ActionCallback, onSuccess.GetPointer(),
                        Callbacks.FailureCallback, onFailure.GetPointer());
 }
Esempio n. 11
0
 public void ReportActivity(string activityId, ReportingReason reportingReason, Action onSuccess, Action <GetSocialError> onFailure)
 {
     _getSocial.CallStatic("reportActivity", activityId, reportingReason.ToAndroidJavaObject(), new CompletionCallback(onSuccess, onFailure));
 }