public virtual void DeleteTweet(DeleteTweetOptions options, Action<TwitterStatus, TwitterResponse> action)
		{
			var id = options.Id;
			var trim_user = options.TrimUser;
			
			WithHammock(WebMethod.Delete, action, "statuses/destroy/{id}", FormatAsString, "?id=", id, "&trim_user=", trim_user);
		}
		public virtual IAsyncResult BeginDeleteTweet(DeleteTweetOptions options)
		{
			var id = options.Id;
			var trim_user = options.TrimUser;
				

			return BeginWithHammock<TwitterStatus>(WebMethod.Delete, "statuses/destroy/{id}", FormatAsString, "?id=", id, "&trim_user=", trim_user);
		}
		public virtual Task<TwitterResponse<TwitterStatus>> DeleteTweetAsync(DeleteTweetOptions options)
		{
			var id = options.Id;
			var trim_user = options.TrimUser;
				
			
			return ExecuteRequest<TwitterStatus>(HttpMethod.Delete, "statuses/destroy/{id}", FormatAsString, "?id=", id, "&trim_user=", trim_user);
		}
		public virtual Task<TwitterAsyncResult<TwitterStatus>> DeleteTweetAsync(DeleteTweetOptions options)
		{
			var id = options.Id;
			var trim_user = options.TrimUser;
			
			return WithHammockTask<TwitterStatus>(_client, WebMethod.Post, "statuses/destroy/{id}", FormatAsString, "?id=", id, "&trim_user=", trim_user);
		}
		public virtual IAsyncResult DeleteTweet(DeleteTweetOptions options, Action<TwitterStatus, TwitterResponse> action)
		{
			var id = options.Id;
			var trim_user = options.TrimUser;
				

			return WithHammock(_client, WebMethod.Post, action, "statuses/destroy/{id}", FormatAsString, "?id=", id, "&trim_user=", trim_user);
		}
Exemplo n.º 6
0
        /// <summary>
        /// Deletes a specified tweet
        /// </summary>
        private void RemoveTweet(string command)
        {
            if (command.Split(' ')[1].Length != 2)
            {
                ScreenDraw.ShowMessage("Wrong syntax. Use /del [id]");
            }
            else
            {
                long tweetID = (Int64)TweetIdentification.GetTweetID(command.Split(' ')[1]).InReplyToStatusId;
                InteractiveTweet tweet = TweetIdentification.FindTweet(tweetID);
                if (tweet.IsDirectMessage)
                {
                    DeleteDirectMessageOptions delOpts = new DeleteDirectMessageOptions();
                    delOpts.Id = tweetID;
                }
                else
                {
                    DeleteTweetOptions delOpts = new DeleteTweetOptions();
                    delOpts.Id = tweetID;

                    User.Account.DeleteTweet(delOpts);
                }
                TwitterResponse result = User.Account.Response;
                if (result.Error == null)
                {
                    GetUpdates.localTweetList.Remove(TweetIdentification.FindTweet(tweetID));
                    ScreenDraw.ShowMessage("Deleted");
                    ScreenDraw draw = new ScreenDraw();
                    draw.ShowTimeline();
                    User.CounterConsoleWin.Refresh();
                }
                else
                {
                    ScreenDraw.ShowMessage(result.Error.Code + ": " + result.Error.Message);
                }

            }
        }