# HG changeset patch # User Mikael Berthe # Date 1267366767 -3600 # Node ID e6e89b1d783100b0ff2760cbd6ac0c1c92550633 # Parent 15b3834cbe5f3f161739a1e398314a7f19167160 Minor style and header updates diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/caps.c --- a/mcabber/mcabber/caps.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/caps.c Sun Feb 28 15:19:27 2010 +0100 @@ -134,7 +134,7 @@ return g_strcmp0(a, b); } -//generates the sha1 hash for the special capability "" and returns it +// Generates the sha1 hash for the special capability "" and returns it const char *caps_generate(void) { char *identity; diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/commands.c --- a/mcabber/mcabber/commands.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/commands.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * commands.c -- user commands handling * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -198,7 +198,6 @@ cmd_add("say_to", "Say something to a specific buddy", COMPL_JID, 0, &do_say_to); cmd_add("screen_refresh", "Redraw mcabber screen", 0, 0, &do_screen_refresh); - //cmd_add("search"); cmd_add("set", "Set/query an option value", 0, 0, &do_set); cmd_add("source", "Read a configuration file", 0, 0, &do_source); cmd_add("status", "Show or set your status", COMPL_STATUS, 0, &do_status); @@ -1274,10 +1273,10 @@ static LmMessageSubType scan_mtype(char **arg) { - //Try splitting it + // Try splitting it char **parlist = split_arg(*arg, 2, 1); LmMessageSubType result = LM_MESSAGE_SUB_TYPE_NOT_SET; - //Is it any good parameter? + // Is it a good parameter? if (parlist && *parlist) { if (!strcmp("-n", *parlist)) { result = LM_MESSAGE_SUB_TYPE_NORMAL; @@ -1287,7 +1286,7 @@ if (result != LM_MESSAGE_SUB_TYPE_NOT_SET || (!strcmp("--", *parlist))) *arg += strlen(*arg) - (parlist[1] ? strlen(parlist[1]) : 0); } - //Anything found? -> skip it + // Anything found? -> skip it free_arg_lst(parlist); return result; } diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/compl.c --- a/mcabber/mcabber/compl.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/compl.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * compl.c -- Completion system * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -138,7 +138,6 @@ // cancel_completion() // Returns the number of chars to delete to cancel the completion -//guint cancel_completion(compl *c) guint cancel_completion(void) { if (!InputCompl) return 0; diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/events.c --- a/mcabber/mcabber/events.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/events.c Sun Feb 28 15:19:27 2010 +0100 @@ -202,7 +202,7 @@ event->notify(event->data); if (event->source) g_source_remove(event->source); - + evs_list = g_slist_remove(evs_list, event); g_free(event->id); g_free(event->description); diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/hbuf.c --- a/mcabber/mcabber/hbuf.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/hbuf.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * hbuf.c -- History buffer implementation * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/help.c --- a/mcabber/mcabber/help.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/help.c Sun Feb 28 15:19:27 2010 +0100 @@ -168,7 +168,7 @@ fname = g_strdup_printf("%s/hlp_%s.txt", path, arg); else fname = g_strdup_printf("%s/hlp.txt", path); - + channel = g_io_channel_new_file(fname, "r", NULL); if (!channel) @@ -179,7 +179,7 @@ while (TRUE) { gsize endpos; GIOStatus ret; - + ret = g_io_channel_read_line_string(channel, line, &endpos, NULL); if (ret != G_IO_STATUS_NORMAL) // XXX G_IO_STATUS_AGAIN? break; @@ -234,7 +234,7 @@ if (settings_opt_get_int("help_to_current") && CURRENT_JID) jid = CURRENT_JID; - + { // search GSList *hel; @@ -268,7 +268,7 @@ if (g_strstr_len(nstart, len, string)) { gchar *match = g_strndup(nstart, len); - + if (!g_slist_find_custom(matches, match, (GCompareFunc)strcmp)) matches = g_slist_append(matches, match); diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/histolog.c --- a/mcabber/mcabber/histolog.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/histolog.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * histolog.c -- File history handling * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/hooks.c --- a/mcabber/mcabber/hooks.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/hooks.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * hooks.c -- Hooks layer * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/main.c --- a/mcabber/mcabber/main.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/main.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * main.c * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * Parts of this file come from Cabber * * This program is free software; you can redistribute it and/or modify diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/otr.c --- a/mcabber/mcabber/otr.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/otr.c Sun Feb 28 15:19:27 2010 +0100 @@ -119,7 +119,7 @@ { char *root; - if (userstate) //already initialised + if (userstate) // already initialised return; otr_is_enabled = !!settings_opt_get_int("otr"); @@ -167,7 +167,7 @@ * This is reported to be a bug in libgcrypt :-/ * Mikael */ -#if defined(HAVE_GNUTLS) && !defined(HAVE_OPENSSL) //TODO: broken now +#if defined(HAVE_GNUTLS) && !defined(HAVE_OPENSSL) // TODO: broken now if (!settings_opt_get_int("ssl")) #endif otrl_userstate_free(userstate); diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/roster.c --- a/mcabber/mcabber/roster.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/roster.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * roster.c -- Local roster implementation * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -168,7 +168,6 @@ // Resources are sorted in ascending order static gint resource_compare_prio(res *a, res *b) { - //return (a->prio - b->prio); if (a->prio < b->prio) return -1; else return 1; } diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/screen.c --- a/mcabber/mcabber/screen.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/screen.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * screen.c -- UI stuff * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * Parts of this file come from the Cabber project * * This program is free software; you can redistribute it and/or modify @@ -253,14 +253,14 @@ return NULL; ccol = g_new0(ccolor, 1); ccol->color_attrib = isbright ? A_BOLD : A_NORMAL; - ccol->color_pair = cl + COLOR_max; //user colors come after the internal ones + ccol->color_pair = cl + COLOR_max; // User colors come after the internal ones return ccol; } static void ensure_string_htable(GHashTable **table, GDestroyNotify value_destroy_func) { - if (*table)//Have it already + if (*table) // Have it already return; *table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, value_destroy_func); @@ -273,7 +273,7 @@ void scr_MucColor(const char *muc, muccoltype type) { gchar *muclow = g_utf8_strdown(muc, -1); - if (type == MC_REMOVE) {//Remove it + if (type == MC_REMOVE) { // Remove it if (strcmp(muc, "*")) { if (muccolors && g_hash_table_lookup(muccolors, muclow)) g_hash_table_remove(muccolors, muclow); @@ -281,7 +281,7 @@ scr_LogPrint(LPRINT_NORMAL, "Can not remove global coloring mode"); } g_free(muclow); - } else {//Add or overwrite + } else { // Add or overwrite if (strcmp(muc, "*")) { muccoltype *value = g_new(muccoltype, 1); *value = type; @@ -292,7 +292,7 @@ g_free(muclow); } } - //Need to redraw? + // Need to redraw? if (chatmode && ((buddy_search_jid(muc) == current_buddy) || !strcmp(muc, "*"))) scr_UpdateBuddyWindow(); @@ -307,17 +307,17 @@ bool need_update = FALSE; snick = g_strdup_printf("<%s>", nick); mnick = g_strdup_printf("*%s ", nick); - if (!strcmp(color, "-")) {//Remove the color + if (!strcmp(color, "-")) { // Remove the color if (nickcolors) { nickcolor *nc = g_hash_table_lookup(nickcolors, snick); - if (nc) {//Have this nick already + if (nc) { // Have this nick already nc->manual = FALSE; nc = g_hash_table_lookup(nickcolors, mnick); - assert(nc);//Must have both at the same time + assert(nc); // Must have both at the same time nc->manual = FALSE; }// Else -> no color saved, nothing to delete } - g_free(snick);//They are not saved in the hash + g_free(snick); // They are not saved in the hash g_free(mnick); need_update = TRUE; } else { @@ -331,9 +331,9 @@ ensure_string_htable(&nickcolors, NULL); nc->manual = TRUE; nc->color = cl; - //Free the struct, if any there already + // Free the struct, if any there already g_free(g_hash_table_lookup(nickcolors, mnick)); - //Save the new ones + // Save the new ones g_hash_table_replace(nickcolors, mnick, nc); g_hash_table_replace(nickcolors, snick, nc); need_update = TRUE; @@ -383,7 +383,7 @@ break; } } - if (!strcmp(color,"-")) {//Delete the rule + if (!strcmp(color,"-")) { // Delete the rule if (found) { free_rostercolrule(found->data); rostercolrules = g_slist_delete_link(rostercolrules, found); @@ -540,7 +540,7 @@ } g_free(ncolor_start); } - if (!nickcols) {//Fallback to have something + if (!nickcols) { // Fallback to have something nickcolcount = 1; nickcols = g_new(ccolor*, 1); *nickcols = g_new(ccolor, 1); @@ -1335,7 +1335,7 @@ num_history_blocks = get_max_history_blocks(); text_locale = from_utf8(text); - //Convert the nick alone and compute its length + // Convert the nick alone and compute its length if (mucnicklen) { nicktmp = g_strndup(text, mucnicklen); nicklocaltmp = from_utf8(nicktmp); @@ -1948,7 +1948,7 @@ wattrset(rosterWnd, get_color(COLOR_ROSTERNMSG)); else { int color = get_color(COLOR_ROSTER); - if ((!isspe) && (!isgrp)) {//Look for color rules + if ((!isspe) && (!isgrp)) { // Look for color rules GSList *head; const char *jid = buddy_getjid(BUDDATA(buddy)); for (head = rostercolrules; head; head = g_slist_next(head)) { @@ -2660,7 +2660,6 @@ win_entry->bd->lock = TRUE; } else { win_entry->bd->lock = FALSE; - //win_entry->bd->cleared = FALSE; if (isspe || (buddy_getflags(BUDDATA(current_buddy)) & ROSTER_FLAG_MSG)) win_entry->bd->top = NULL; } diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/settings.c --- a/mcabber/mcabber/settings.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/settings.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * settings.c -- Configuration stuff * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -251,14 +251,11 @@ key = assignment; // Remove leading spaces in option name while ((!isalnum(*key)) && (*key != '=') && *key) { - //if (!isblank(*key)) - // scr_LogPrint("Error in assignment parsing!"); key++; } if (!*key) return FALSE; // Empty assignment if (*key == '=') { - //scr_LogPrint("Cannot parse assignment!"); return FALSE; } // Ok, key points to the option name @@ -266,7 +263,6 @@ for (val = key+1 ; *val && (*val != '=') ; val++) if (!isalnum(*val) && !isblank(*val) && (*val != '_') && (*val != '-')) { // Key should only have alnum chars... - //scr_LogPrint("Error in assignment parsing!"); return FALSE; } // Remove trailing spaces in option name: @@ -275,8 +271,7 @@ // Check for embedded whitespace characters for (p = key; p < t; p++) { if (isblank(*p)) { - //scr_LogPrint("Error in assignment parsing!" - // " (Name should not contain space chars)"); + // Name should not contain space chars... return FALSE; } } diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/utils.c --- a/mcabber/mcabber/utils.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/utils.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,7 +1,7 @@ /* * utils.c -- Various utility functions * - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2005-2010 Mikael Berthe * Some of the ut_* functions are derived from Cabber debug/log code. * from_iso8601() comes from the Pidgin (libpurple) project. * diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/xmpp.c --- a/mcabber/mcabber/xmpp.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/xmpp.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,8 +1,8 @@ /* * xmpp.c -- Jabber protocol handling * - * Copyright (C) 2008-2009 Frank Zschockelt - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2008-2010 Frank Zschockelt + * Copyright (C) 2005-2010 Mikael Berthe * Parts come from the centericq project: * Copyright (C) 2002-2005 by Konstantin Klyagin * @@ -204,8 +204,8 @@ } // Cancel the subscriptions - xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); //cancel "from" - xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE); //cancel "to" + xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); // cancel "from" + xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE); // cancel "to" // Ask for removal from roster iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, @@ -422,7 +422,7 @@ g_free(enc); } - //XEP-0184: Message Receipts + // XEP-0184: Message Receipts if (sl_buddy && rname && xep184 && caps_has_feature(buddy_resource_getcaps(sl_buddy->data, rname), NS_RECEIPTS)) { @@ -768,7 +768,7 @@ if (!res_pgpdata) return; - if (!node->name || strcmp(node->name, "x")) //XXX: probably useless + if (!node->name || strcmp(node->name, "x")) // XXX: probably useless return; // We expect "" // Get signature @@ -1266,7 +1266,7 @@ if (from && (body || subject)) gotmessage(mstype, from, body, enc, subject, timestamp, lm_message_node_find_xmlns(m->node, NS_SIGNED)); - //report received message if message receipt was requested + // Report received message if message receipt was requested if (lm_message_node_get_child(m->node, "request")) { LmMessage *rcvd = lm_message_new(from, LM_MESSAGE_TYPE_MESSAGE); lm_message_node_set_attribute(rcvd->node, "id", lm_message_get_id(m)); @@ -1575,7 +1575,7 @@ return LM_HANDLER_RESULT_REMOVE_MESSAGE; } -//TODO: Use the enum of loudmouth, when it's included in the header... +// TODO: Use the enum of loudmouth, when it's included in the header... typedef enum { LM_LOG_LEVEL_VERBOSE = 1 << (G_LOG_LEVEL_USER_SHIFT), LM_LOG_LEVEL_NET = 1 << (G_LOG_LEVEL_USER_SHIFT + 1), diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/xmpp_helper.c --- a/mcabber/mcabber/xmpp_helper.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/xmpp_helper.c Sun Feb 28 15:19:27 2010 +0100 @@ -133,8 +133,8 @@ node->next->prev = prev_sibling; } -//maybe not a good idea, because it uses internals of loudmouth... -//it's used for rosternotes/bookmarks +// Maybe not a good idea, because it uses internals of loudmouth... +// It's used for rosternotes/bookmarks LmMessageNode *lm_message_node_new(const gchar *name, const gchar *xmlns) { LmMessageNode *node; diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/xmpp_iq.c --- a/mcabber/mcabber/xmpp_iq.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/xmpp_iq.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,8 +1,8 @@ /* * xmpp_iq.c -- Jabber protocol IQ-related stuff * - * Copyright (C) 2008-2009 Frank Zschockelt - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2008-2010 Frank Zschockelt + * Copyright (C) 2005-2010 Mikael Berthe * Parts come from the centericq project: * Copyright (C) 2002-2005 by Konstantin Klyagin * Some small parts come from the Pidgin project @@ -383,16 +383,16 @@ lm_message_node_add_child(field, "required", NULL); foreach_buddy(ROSTER_TYPE_ROOM, &_callback_foreach_buddy_groupchat, field); - //TODO: return an error if we are not connected to groupchats + // TODO: return an error if we are not connected to groupchats } else if (action && !strcmp(action, "cancel")) { lm_message_node_set_attribute(command, "status", "canceled"); } else { // (if sessionid and not canceled) - LmMessageNode *form = lm_message_node_find_xmlns(x, "jabber:x:data");//TODO + LmMessageNode *form = lm_message_node_find_xmlns(x, "jabber:x:data");// TODO if (form) { LmMessageNode *field; lm_message_node_set_attribute(command, "status", "completed"); - //TODO: implement sth. like "field?var=groupchats" in xmlnode... + // TODO: implement sth. like "field?var=groupchats" in xmlnode... field = lm_message_node_get_child(form, "field"); while (field && strcmp("groupchats", lm_message_node_get_attribute(field, "var"))) diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/xmpp_iqrequest.c --- a/mcabber/mcabber/xmpp_iqrequest.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/xmpp_iqrequest.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,8 +1,8 @@ /* * xmpp_iqrequest.c -- Jabber IQ request handling * - * Copyright (C) 2008-2009 Frank Zschockelt - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2008-2010 Frank Zschockelt + * Copyright (C) 2005-2010 Mikael Berthe * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 15b3834cbe5f -r e6e89b1d7831 mcabber/mcabber/xmpp_muc.c --- a/mcabber/mcabber/xmpp_muc.c Sun Feb 28 14:15:38 2010 +0100 +++ b/mcabber/mcabber/xmpp_muc.c Sun Feb 28 15:19:27 2010 +0100 @@ -1,8 +1,9 @@ /* * xmpp_muc.c -- Jabber MUC protocol handling * - * Copyright (C) 2008-2009 Frank Zschockelt - * Copyright (C) 2005-2009 Mikael Berthe + * Copyright (C) 2008-2010 Frank Zschockelt + * Copyright (C) 2005-2010 Mikael Berthe + * Copyrigth (C) 2010 Myhailo Danylenko * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by