aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/miz_hi/smileessence/command/status/impl/StatusCommandCopy.java
blob: 672963be8b5dc96dca1020b289ef8608f2a356fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package net.miz_hi.smileessence.command.status.impl;

import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
import net.miz_hi.smileessence.command.status.StatusCommand;
import net.miz_hi.smileessence.model.status.tweet.TweetModel;
import net.miz_hi.smileessence.task.impl.TweetTask;
import twitter4j.StatusUpdate;

public class StatusCommandCopy extends StatusCommand implements IHideable, IConfirmable
{

    public StatusCommandCopy(TweetModel model)
    {
        super(model);
    }

    @Override
    public boolean getDefaultVisibility()
    {
        return Client.getPermission().canCopyTweet();
    }

    @Override
    public String getName()
    {
        return "パクる";
    }

    @Override
    public void workOnUiThread()
    {
        StatusUpdate update = new StatusUpdate(status.getText());
        update.setInReplyToStatusId(status.getInReplyToStatusId());
        new TweetTask(update).callAsync();
        status.favorite();
    }

}