Changeset 74f1cde
- Timestamp:
- 2010-03-27T18:05:38Z (15 years ago)
- Branches:
- master
- Children:
- 410bf6d
- Parents:
- 280c56a
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r280c56a r74f1cde 624 624 irc_channel_add_user( ic, irc->user ); 625 625 626 irc->last_root_cmd = g_strdup( ROOT_CHAN ); 627 626 628 return 1; 627 629 } -
irc.h
r280c56a r74f1cde 65 65 struct irc_user *root; 66 66 struct irc_user *user; 67 68 char *last_root_cmd; 67 69 68 70 char *password; /* HACK: Used to save the user's password, but before … … 86 88 struct bee *b; 87 89 } irc_t; 90 91 typedef enum 92 { 93 IRC_USER_PRIVATE = 1, 94 } irc_user_flags_t; 88 95 89 96 typedef struct irc_user … … 99 106 char *key; 100 107 101 char is_private;108 irc_user_flags_t flags; 102 109 103 110 char *sendbuf; 104 111 int sendbuf_len; 105 112 guint sendbuf_timer; 106 int sendbuf_flags;113 //int sendbuf_flags; 107 114 108 115 //struct user *b; … … 190 197 void irc_send_whois( irc_user_t *iu ); 191 198 void irc_send_who( irc_t *irc, GSList *l, const char *channel ); 199 void irc_send_msg( irc_user_t *iu, const char *type, const char *dst, const char *msg ); 192 200 193 201 /* irc_user.c */ -
irc_channel.c
r280c56a r74f1cde 139 139 static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg ) 140 140 { 141 g_free( ic->irc->last_root_cmd ); 142 ic->irc->last_root_cmd = g_strdup( ic->name ); 143 141 144 root_command_string( ic->irc, msg ); 142 145 -
irc_send.c
r280c56a r74f1cde 109 109 } 110 110 111 /* FIXME/REPLACEME */112 111 void irc_usermsg( irc_t *irc, char *format, ... ) 113 112 { 113 irc_channel_t *ic; 114 irc_user_t *iu; 114 115 char text[1024]; 115 116 va_list params; 116 //irc_user_t *iu;117 117 118 118 va_start( params, format ); … … 120 120 va_end( params ); 121 121 122 fprintf( stderr, "%s\n", text ); 122 if( irc->last_root_cmd && 123 irc_channel_name_ok( irc->last_root_cmd ) && 124 ( ic = irc_channel_by_name( irc, irc->last_root_cmd ) ) && 125 ic->flags & IRC_CHANNEL_JOINED ) 126 irc_send_msg( irc->root, "PRIVMSG", irc->last_root_cmd, text ); 127 else if( irc->last_root_cmd && 128 ( iu = irc_user_by_name( irc, irc->last_root_cmd ) ) && 129 iu->f == &irc_user_root_funcs ) 130 irc_send_msg( iu, "PRIVMSG", irc->user->nick, text ); 131 else 132 { 133 g_free( irc->last_root_cmd ); 134 irc->last_root_cmd = NULL; 135 136 irc_send_msg( irc->root, "PRIVMSG", irc->user->nick, text ); 137 } 123 138 124 139 /*return( irc_msgfrom( irc, u->nick, text ) );*/ -
irc_user.c
r280c56a r74f1cde 34 34 iu->user = iu->host = iu->fullname = iu->nick; 35 35 36 iu-> is_private = set_getbool( &irc->b->set, "private" );36 iu->flags = set_getbool( &irc->b->set, "private" ) ? IRC_USER_PRIVATE : 0; 37 37 38 38 iu->key = g_strdup( nick ); … … 117 117 static gboolean root_privmsg( irc_user_t *iu, const char *msg ) 118 118 { 119 g_free( iu->irc->last_root_cmd ); 120 iu->irc->last_root_cmd = g_strdup( iu->nick ); 121 119 122 root_command_string( iu->irc, msg ); 120 123
Note: See TracChangeset
for help on using the changeset viewer.