Skip to content
Snippets Groups Projects
Commit 29283b52 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Working with long messages

parent afdbd906
No related branches found
No related tags found
No related merge requests found
...@@ -73,8 +73,8 @@ class NotificationFetcher(dbus.service.Object): ...@@ -73,8 +73,8 @@ class NotificationFetcher(dbus.service.Object):
#print("body", body) #print("body", body)
#print("actions", actions) #print("actions", actions)
#print("expire_timeout", expire_timeout) #print("expire_timeout", expire_timeout)
su = strip_tags((summary)).split("\n") su = strip_tags(summary[0:300]).split("\n")
bo = strip_tags((body)).split("\n") bo = strip_tags(body[0:500]).split("\n")
for i in range(len(su)): for i in range(len(su)):
if su[i]!="" and su[i][0]=='-': if su[i]!="" and su[i][0]=='-':
su[i] = ' '+su[i]; su[i] = ' '+su[i];
......
...@@ -3,7 +3,7 @@ cd "$(dirname "$0")" ...@@ -3,7 +3,7 @@ cd "$(dirname "$0")"
killall osdd killall osdd
pkill -f not2osd pkill -f not2osd
not2osd & ./not2osd &
tmp=$(mktemp) tmp=$(mktemp)
echo "Xft.render: False" > $tmp echo "Xft.render: False" > $tmp
XENVIRONMENT=$tmp \ XENVIRONMENT=$tmp \
......
...@@ -250,11 +250,12 @@ parse_msg(unsigned char *buf, int len) ...@@ -250,11 +250,12 @@ parse_msg(unsigned char *buf, int len)
msg->alocated_data=line; msg->alocated_data=line;
bool is_output_set=0; bool is_output_set=0;
while (*line) while (line && *line)
{ {
// The parser is destructive, but it does not do any harm, since we display each message only once. // The parser is destructive, but it does not do any harm, since we display each message only once.
char *nl = strchr(line, '\n'); char *nl = strchr(line, '\n');
*nl++ = 0; if(nl) *nl++ = 0;
else fprintf(stderr,"MISSING END NL!\n");
char *key; char *key;
char *val = strchr(line, ':'); char *val = strchr(line, ':');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment