/[weechat]/weechat/src/common/completion.c
ViewVC logotype

Diff of /weechat/src/common/completion.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by flashcode, Sat Sep 3 12:37:22 2005 UTC revision 1.29 by flashcode, Sun Sep 4 12:55:26 2005 UTC
# Line 102  completion_build_list (t_completion *com Line 102  completion_build_list (t_completion *com
102      int i, j;      int i, j;
103      t_irc_server *ptr_server;      t_irc_server *ptr_server;
104      t_irc_channel *ptr_channel;      t_irc_channel *ptr_channel;
105        t_irc_nick *ptr_nick;
106      char *pos, option_name[256], *string;      char *pos, option_name[256], *string;
107      t_weechat_alias *ptr_alias;      t_weechat_alias *ptr_alias;
108      t_config_option *option;      t_config_option *option;
# Line 201  completion_build_list (t_completion *com Line 202  completion_build_list (t_completion *com
202          }          }
203          return;          return;
204      }      }
205        if (ascii_strcasecmp (completion->base_command, "ignore") == 0)
206        {
207            /* arg 1: nicks of current channel and "*" */
208            if (completion->base_command_arg == 1)
209            {
210                weelist_add (&completion->completion_list,
211                             &completion->last_completion,
212                             "*");
213                if (channel)
214                {
215                    if (((t_irc_channel *)channel)->type == CHAT_CHANNEL)
216                    {
217                        for (ptr_nick = ((t_irc_channel *)channel)->nicks; ptr_nick;
218                             ptr_nick = ptr_nick->next_nick)
219                        {
220                            weelist_add (&completion->completion_list,
221                                         &completion->last_completion,
222                                         ptr_nick->nick);
223                        }
224                    }
225                    if (((t_irc_channel *)channel)->type == CHAT_PRIVATE)
226                    {
227                        weelist_add (&completion->completion_list,
228                                     &completion->last_completion,
229                                     ((t_irc_channel *)channel)->name);
230                    }
231                }
232                return;
233            }
234            
235            /* arg 2: type / command and "*" */
236            if (completion->base_command_arg == 2)
237            {
238                weelist_add(&completion->completion_list,
239                            &completion->last_completion,
240                            "*");
241                i = 0;
242                while (ignore_types[i])
243                {
244                    weelist_add (&completion->completion_list,
245                                 &completion->last_completion,
246                                 ignore_types[i]);
247                    i++;
248                }
249                i = 0;
250                while (irc_commands[i].command_name)
251                {
252                    if (irc_commands[i].recv_function)
253                        weelist_add(&completion->completion_list,
254                                    &completion->last_completion,
255                                    irc_commands[i].command_name);
256                    i++;
257                }
258                return;
259            }
260            
261            /* arg 3: channel and "*" */
262            if (completion->base_command_arg == 3)
263            {
264                weelist_add(&completion->completion_list,
265                            &completion->last_completion,
266                            "*");
267                if (((t_irc_channel *)channel)->type == CHAT_CHANNEL)
268                    weelist_add(&completion->completion_list,
269                                &completion->last_completion,
270                                ((t_irc_channel *)channel)->name);
271                return;
272            }
273            
274            /* arg 4: server */
275            if (completion->base_command_arg == 4)
276            {
277                weelist_add(&completion->completion_list,
278                            &completion->last_completion,
279                            "*");
280                if (SERVER(gui_current_window->buffer))
281                    weelist_add(&completion->completion_list,
282                                &completion->last_completion,
283                                SERVER(gui_current_window->buffer)->name);
284                return;
285            }
286        }
287      if (ascii_strcasecmp (completion->base_command, "key") == 0)      if (ascii_strcasecmp (completion->base_command, "key") == 0)
288      {      {
289          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
# Line 254  completion_build_list (t_completion *com Line 337  completion_build_list (t_completion *com
337              for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)              for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
338              {              {
339                  if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)                  if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
340                      && (i != CONFIG_SECTION_SERVER))                      && (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
341                  {                  {
342                      for (j = 0; weechat_options[i][j].option_name; j++)                      for (j = 0; weechat_options[i][j].option_name; j++)
343                      {                      {

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26