Mercurial > pidgin
comparison plugins/log_reader.c @ 13491:0dbab0e08f2a
[gaim-migrate @ 15867]
gaim_find_buddy() can return NULL.
Resolves CID 98
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Mon, 13 Mar 2006 17:52:37 +0000 |
| parents | dfd9eaeae114 |
| children | e8b0a9376481 |
comparison
equal
deleted
inserted
replaced
| 13490:40c5d0508a1a | 13491:0dbab0e08f2a |
|---|---|
| 692 /* Reading the file was successful... | 692 /* Reading the file was successful... |
| 693 * Save its name if it involves the crazy numbers. The idea here is that you could | 693 * Save its name if it involves the crazy numbers. The idea here is that you could |
| 694 * then tweak the blist.xml file by hand if need be. This would be the case if two | 694 * then tweak the blist.xml file by hand if need be. This would be the case if two |
| 695 * buddies have the same username at different domains. One set of logs would get | 695 * buddies have the same username at different domains. One set of logs would get |
| 696 * detected for both buddies. | 696 * detected for both buddies. |
| 697 * | |
| 698 * I can't think of how buddy would be NULL. | |
| 699 */ | 697 */ |
| 700 if (buddy && logfile) { | 698 if (buddy && logfile) { |
| 701 gaim_blist_node_set_string(&buddy->node, "log_reader_msn_log_filename", logfile); | 699 gaim_blist_node_set_string(&buddy->node, "log_reader_msn_log_filename", logfile); |
| 702 g_free(logfile); | 700 g_free(logfile); |
| 703 } | 701 } |
| 1416 if (*line) | 1414 if (*line) |
| 1417 line++; | 1415 line++; |
| 1418 g_string_append(formatted, "</b>"); | 1416 g_string_append(formatted, "</b>"); |
| 1419 footer = NULL; | 1417 footer = NULL; |
| 1420 } else if (strstr(line, " signed off ")) { | 1418 } else if (strstr(line, " signed off ")) { |
| 1421 if (buddy->alias) | 1419 if (buddy != NULL && buddy->alias) |
| 1422 g_string_append_printf(formatted, | 1420 g_string_append_printf(formatted, |
| 1423 _("%s has signed off."), buddy->alias); | 1421 _("%s has signed off."), buddy->alias); |
| 1424 else | 1422 else |
| 1425 g_string_append_printf(formatted, | 1423 g_string_append_printf(formatted, |
| 1426 _("%s has signed off."), log->name); | 1424 _("%s has signed off."), log->name); |
| 1427 line = ""; | 1425 line = ""; |
| 1428 } else if (strstr(line, " signed on ")) { | 1426 } else if (strstr(line, " signed on ")) { |
| 1429 if (buddy->alias) | 1427 if (buddy != NULL && buddy->alias) |
| 1430 g_string_append(formatted, buddy->alias); | 1428 g_string_append(formatted, buddy->alias); |
| 1431 else | 1429 else |
| 1432 g_string_append(formatted, log->name); | 1430 g_string_append(formatted, log->name); |
| 1433 line = " logged in."; | 1431 line = " logged in."; |
| 1434 } else if (g_str_has_prefix(line, | 1432 } else if (g_str_has_prefix(line, |
| 1482 } | 1480 } |
| 1483 | 1481 |
| 1484 footer = "</span></b>"; | 1482 footer = "</span></b>"; |
| 1485 } | 1483 } |
| 1486 } else if (g_str_has_prefix(line, data->their_nickname)) { | 1484 } else if (g_str_has_prefix(line, data->their_nickname)) { |
| 1487 if (buddy->alias) { | 1485 if (buddy != NULL && buddy->alias) { |
| 1488 line += strlen(data->their_nickname) + 2; | 1486 line += strlen(data->their_nickname) + 2; |
| 1489 g_string_append_printf(formatted, | 1487 g_string_append_printf(formatted, |
| 1490 "<span style=\"color: #A82F2F;\">" | 1488 "<span style=\"color: #A82F2F;\">" |
| 1491 "<b>%s</b></span>: ", buddy->alias); | 1489 "<b>%s</b></span>: ", buddy->alias); |
| 1492 } | 1490 } |
