Software /
code /
prosody
Comparison
util/filters.lua @ 6366:8dee696c33cc 0.9.5
util.filters: Ignore filters being added twice (fixes issues on removal)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 28 Aug 2014 09:20:33 +0100 |
parent | 5849:8f451d370dd4 |
child | 6367:769a3577dd85 |
comparison
equal
deleted
inserted
replaced
6365:75bd55e84112 | 6366:8dee696c33cc |
---|---|
43 | 43 |
44 local filter_list = session.filters[type]; | 44 local filter_list = session.filters[type]; |
45 if not filter_list then | 45 if not filter_list then |
46 filter_list = {}; | 46 filter_list = {}; |
47 session.filters[type] = filter_list; | 47 session.filters[type] = filter_list; |
48 elseif filter_list[callback] then | |
49 return; -- Filter already added | |
48 end | 50 end |
49 | 51 |
50 priority = priority or 0; | 52 priority = priority or 0; |
51 | 53 |
52 local i = 0; | 54 local i = 0; |