Changeset 9cf63ac


Ignore:
Timestamp:
2016-03-31T18:49:52Z (9 years ago)
Author:
Flexo <nick@…>
Branches:
master
Children:
0d581bd
Parents:
fb62f132
Message:

Add mute and unmute commands.

Location:
protocols/twitter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    rfb62f132 r9cf63ac  
    958958                twitter_remove_buddy(ic, cmd[1], NULL);
    959959                goto eof;
     960        } else if (g_strcasecmp(cmd[0], "mute") == 0 && cmd[1]) {
     961                twitter_mute_create_destroy(ic, cmd[1], 1);
     962                goto eof;
     963        } else if (g_strcasecmp(cmd[0], "unmute") == 0 && cmd[1]) {
     964                twitter_mute_create_destroy(ic, cmd[1], 0);
     965                goto eof;
    960966        } else if ((g_strcasecmp(cmd[0], "report") == 0 ||
    961967                    g_strcasecmp(cmd[0], "spam") == 0) && cmd[1]) {
  • protocols/twitter/twitter_lib.c

    rfb62f132 r9cf63ac  
    16531653}
    16541654
     1655/**
     1656 * Mute or unmute a user
     1657 */
     1658void twitter_mute_create_destroy(struct im_connection *ic, char *who, int create)
     1659{
     1660        char *args[2];
     1661
     1662        args[0] = "screen_name";
     1663        args[1] = who;
     1664        twitter_http(ic, create ? TWITTER_MUTES_CREATE_URL : TWITTER_MUTES_DESTROY_URL,
     1665                     twitter_http_post, ic, 1, args, 2);
     1666}
     1667
    16551668void twitter_status_destroy(struct im_connection *ic, guint64 id)
    16561669{
  • protocols/twitter/twitter_lib.h

    rfb62f132 r9cf63ac  
    7878#define TWITTER_BLOCKS_DESTROY_URL "/blocks/destroy/"
    7979
     80/* Mute URLs */
     81#define TWITTER_MUTES_CREATE_URL "/mutes/users/create.json"
     82#define TWITTER_MUTES_DESTROY_URL "/mutes/users/destroy.json"
     83
    8084/* Report spam */
    8185#define TWITTER_REPORT_SPAM_URL "/users/report_spam.json"
     
    96100void twitter_direct_messages_new(struct im_connection *ic, char *who, char *message);
    97101void twitter_friendships_create_destroy(struct im_connection *ic, char *who, int create);
     102void twitter_mute_create_destroy(struct im_connection *ic, char *who, int create);
    98103void twitter_status_destroy(struct im_connection *ic, guint64 id);
    99104void twitter_status_retweet(struct im_connection *ic, guint64 id);
Note: See TracChangeset for help on using the changeset viewer.